Add 'did you mean' suggestion when accessing an undefined variable.
--
PiperOrigin-RevId: 143373605
MOS_MIGRATED_REVID=143373605
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index f6493ba..38874b8 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -1044,6 +1044,15 @@
}
@Test
+ public void testTypo() throws Exception {
+ new SkylarkTest()
+ .testIfErrorContains(
+ "name 'my_variable' is not defined (did you mean 'myVariable'?)",
+ "myVariable = 2",
+ "x = my_variable + 1");
+ }
+
+ @Test
public void testNoneTrueFalseInSkylark() throws Exception {
new SkylarkTest().setUp("a = None",
"b = True",