diff options
author | 2017-09-25 21:11:31 +0200 | |
---|---|---|
committer | 2017-09-26 12:30:28 +0200 | |
commit | aa12ec3dc70797c3c514f9f08a976c6ad79ffd38 (patch) | |
tree | 9771cdc2c623363f16ec6545bace1d8293bf559c /src | |
parent | 8e967419ef8405236c36d4c5a93e9b52177a63dc (diff) |
Add a test for traceback correctness for errors in augmented assignment nodes
PiperOrigin-RevId: 169942209
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java index 67f691e4cd..081f1ad478 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java @@ -392,6 +392,25 @@ public class MethodLibraryTest extends EvaluationTestCase { } @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 // only one built-in function. |