diff options
author | 2017-05-31 23:03:08 +0200 | |
---|---|---|
committer | 2017-06-01 14:08:48 +0200 | |
commit | ca600bf2d014650b1f1ecb5214878b09a0838086 (patch) | |
tree | 283a3f4fbb49c99654aa52627eb1a6b22a5d60e9 /src/test/java/com/google/devtools/common | |
parent | 105a47e0634cb348dd6ded5327e33f3b2b6ac5a9 (diff) |
Remove support of --no_ prefix for boolean flags.
The no_ prefix was initially undocumented, but its support has over time
lead to a number of inconsistencies.
RELNOTES: --no_ prefix no longer recognized.
PiperOrigin-RevId: 157631435
Diffstat (limited to 'src/test/java/com/google/devtools/common')
-rw-r--r-- | src/test/java/com/google/devtools/common/options/OptionsParserTest.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/common/options/OptionsParserTest.java b/src/test/java/com/google/devtools/common/options/OptionsParserTest.java index b122aba5b0..91de13774f 100644 --- a/src/test/java/com/google/devtools/common/options/OptionsParserTest.java +++ b/src/test/java/com/google/devtools/common/options/OptionsParserTest.java @@ -1586,16 +1586,15 @@ public class OptionsParserTest { } @Test - public void testBooleanUnderscorePrefixError() throws OptionsParsingException { - OptionsParser parser = newOptionsParser(ExampleBooleanFooOptions.class); - parser.parse("--no_foo"); - ExampleBooleanFooOptions result = parser.getOptions(ExampleBooleanFooOptions.class); - assertThat(result.foo).isFalse(); - List<String> warning = parser.getWarnings(); - assertThat(warning).hasSize(1); - assertThat(warning.get(0)).contains("Option 'foo' is specified using the deprecated " - + "--no_ prefix. Use --no without the underscore instead"); + public void testBooleanUnderscorePrefixError() { + try { + OptionsParser parser = newOptionsParser(ExampleBooleanFooOptions.class); + parser.parse("--no_foo"); + fail("--no_foo should fail to parse."); + } catch (OptionsParsingException e) { + assertThat(e).hasMessageThat().contains("Unrecognized option: --no_foo"); + } } public static class WrapperOptionExample extends OptionsBase { |