Add a test for traceback correctness for errors in augmented assignment nodes
@@ -391,6 +391,25 @@ public class MethodLibraryTest extends EvaluationTestCase {
"foo()");
}
+ @Test
+ public void testStackTraceWithAugmentedAssignment() throws Exception {
+ new SkylarkTest()
+ .testIfErrorContains(
+ "File \"\", line 4"
+ + LINE_SEPARATOR
+ + "\t\tfoo()"
+ + LINE_SEPARATOR
+ + "\tFile \"\", line 3, in foo"
+ + LINE_SEPARATOR
+ + "\t\ts += \"2\""
+ + LINE_SEPARATOR
+ + "unsupported operand type(s) for +: 'int' and 'string'",
+ "def foo():",
+ " s = 1",
+ " s += '2'",
+ "foo()");
+ }
+
@Test
public void testStackTraceSkipBuiltInOnly() throws Exception {
// The error message should not include the stack trace when there is
