diff options
author | brandjon <brandjon@google.com> | 2017-05-08 09:11:05 -0400 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2017-05-08 09:50:31 -0400 |
commit | 2a9a1b7a67777c5163e551df47b727fc6880fc7f (patch) | |
tree | 29c281695e8a7e2e8c746e74aefda2cf7121b517 /src/test | |
parent | fa50c3ddd67d835a134ea8da0cb9ba02fed704d1 (diff) |
Rename some --incompatible_* flags to be more specific
This is possibly a nit, but we don't want to reuse flag names in the future, so it's a good idea to include what the flag *does* in the name as opposed to just the feature it affects, in case the same feature is changed multiple times. Updated javadoc for incompatible change system to say so.
This rename is ok because these flags have only been submitted over the past couple days.
RELNOTES: None
PiperOrigin-RevId: 155371363
Diffstat (limited to 'src/test')
3 files changed, 13 insertions, 12 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java b/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java index 71d90cdf00..258d219431 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/FunctionTest.java @@ -337,13 +337,13 @@ public class FunctionTest extends EvaluationTestCase { @Test public void testKeywordOnlyIsForbidden() throws Exception { - env = newEnvironmentWithSkylarkOptions("--incompatible_keyword_only_syntax=true"); + env = newEnvironmentWithSkylarkOptions("--incompatible_disallow_keyword_only_args=true"); checkEvalErrorContains("forbidden", "def foo(a, b, *, c): return a + b + c"); } @Test public void testParamAfterStarArgs() throws Exception { - env = newEnvironmentWithSkylarkOptions("--incompatible_keyword_only_syntax=true"); + env = newEnvironmentWithSkylarkOptions("--incompatible_disallow_keyword_only_args=true"); checkEvalErrorContains("forbidden", "def foo(a, *b, c): return a"); } @@ -428,7 +428,7 @@ public class FunctionTest extends EvaluationTestCase { @Test public void testIncompatibleStarParam() throws Exception { - env = newEnvironmentWithSkylarkOptions("--incompatible_keyword_only_syntax=true"); + env = newEnvironmentWithSkylarkOptions("--incompatible_disallow_keyword_only_args=true"); eval("def f(name, value = '1', optional = '2', *rest):", " r = name + value + optional + '|'", " for x in rest: r += x", 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 b87094d13d..b88d972ca0 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 @@ -988,7 +988,7 @@ public class SkylarkEvaluationTest extends EvaluationTest { @Test public void testPlusEqualsOnListCopying() throws Exception { - new SkylarkTest("--incompatible_list_plus_equals=false") + new SkylarkTest("--incompatible_list_plus_equals_inplace=false") .setUp( "def func():", " l1 = [1, 2]", @@ -1001,7 +1001,7 @@ public class SkylarkEvaluationTest extends EvaluationTest { @Test public void testPlusEqualsOnListMutating() throws Exception { - new SkylarkTest("--incompatible_list_plus_equals=true") + new SkylarkTest("--incompatible_list_plus_equals_inplace=true") .setUp( "def func():", " l1 = [1, 2]", @@ -1012,7 +1012,7 @@ public class SkylarkEvaluationTest extends EvaluationTest { .testLookup("lists", "([1, 2, 3, 4], [1, 2, 3, 4])"); // The same but with += after an IndexExpression - new SkylarkTest("--incompatible_list_plus_equals=true") + new SkylarkTest("--incompatible_list_plus_equals_inplace=true") .setUp( "def func():", " l = [1, 2]", @@ -1025,7 +1025,7 @@ public class SkylarkEvaluationTest extends EvaluationTest { @Test public void testPlusEqualsOnTuple() throws Exception { - new SkylarkTest("--incompatible_list_plus_equals=false") + new SkylarkTest("--incompatible_list_plus_equals_inplace=false") .setUp( "def func():", " t1 = (1, 2)", @@ -1038,8 +1038,9 @@ public class SkylarkEvaluationTest extends EvaluationTest { SkylarkList.Tuple.of(1, 2, 3, 4) )); - // This behavior should remain the same regardless of the incompatible_list_plus_equals flag - new SkylarkTest("--incompatible_list_plus_equals=true") + // This behavior should remain the same regardless of the + // --incompatible_list_plus_equals_inplace flag + new SkylarkTest("--incompatible_list_plus_equals_inplace=true") .setUp( "def func():", " t1 = (1, 2)", @@ -1065,10 +1066,10 @@ public class SkylarkEvaluationTest extends EvaluationTest { @Test public void testPlusOnDictDeprecated() throws Exception { - new SkylarkTest("--incompatible_dict_plus=true") + new SkylarkTest("--incompatible_disallow_dict_plus=true") .testIfErrorContains( "The `+` operator for dicts is deprecated and no longer supported.", "{1: 2} + {3: 4}"); - new SkylarkTest("--incompatible_dict_plus=true") + new SkylarkTest("--incompatible_disallow_dict_plus=true") .testIfErrorContains( "The `+` operator for dicts is deprecated and no longer supported.", "def func():", diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkNestedSetTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkNestedSetTest.java index 4a4cc0f961..c42905fa37 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkNestedSetTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkNestedSetTest.java @@ -45,7 +45,7 @@ public class SkylarkNestedSetTest extends EvaluationTestCase { @Test public void testLegacyConstructorDeprecation() throws Exception { - env = newEnvironmentWithSkylarkOptions("--incompatible_depset_constructor=true"); + env = newEnvironmentWithSkylarkOptions("--incompatible_disallow_set_constructor=true"); try { eval("s = set([1, 2, 3], order='postorder')"); Assert.fail("`set` should have failed"); |