diff options
author | 2017-09-11 20:03:02 +0200 | |
---|---|---|
committer | 2017-09-12 14:05:08 +0200 | |
commit | 1dce09721f8361240bbf056fd508f1ac5fdcfd32 (patch) | |
tree | 2406d3ab794db15d509adc842121bfa9f6c6eb84 /src/test/java/com/google/devtools | |
parent | 5a77f426e0896031973ce1dc965f05e014ee9a24 (diff) |
Replace referrals to options by their name to option definitions.
Now that we have a standard way of referring to an option, remove all of the places that we were referring to them by their name. Since options can have multiple names, this is more clear and provides the additional information needed to understand the option. It also stops the habit of requesting unqualified strings, which was hard to read.
RELNOTES: None.
PiperOrigin-RevId: 168254584
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r-- | src/test/java/com/google/devtools/common/options/OptionsParserTest.java | 6 |
1 files changed, 3 insertions, 3 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 54bb47fa3b..2ef6eefbbd 100644 --- a/src/test/java/com/google/devtools/common/options/OptionsParserTest.java +++ b/src/test/java/com/google/devtools/common/options/OptionsParserTest.java @@ -1190,7 +1190,7 @@ public class OptionsParserTest { Arrays.asList("--simple=abc")); OptionValueDescription result = parser.getOptionValueDescription("simple"); assertThat(result).isNotNull(); - assertThat(result.getName()).isEqualTo("simple"); + assertThat(result.getOptionDefinition().getOptionName()).isEqualTo("simple"); assertThat(result.getValue()).isEqualTo("abc"); assertThat(result.getPriority()).isEqualTo(OptionPriority.COMMAND_LINE); assertThat(result.getSource()).isEqualTo("my description"); @@ -1562,7 +1562,7 @@ public class OptionsParserTest { OptionPriority expectedPriority, String expectedSource, OptionValueDescription actual) { assertThat(actual).isNotNull(); - assertThat(actual.getName()).isEqualTo(expectedName); + assertThat(actual.getOptionDefinition().getOptionName()).isEqualTo(expectedName); assertThat(actual.getValue()).isEqualTo(expectedValue); assertThat(actual.getPriority()).isEqualTo(expectedPriority); assertThat(actual.getSource()).isEqualTo(expectedSource); @@ -1578,7 +1578,7 @@ public class OptionsParserTest { assertThat(result).hasSize(5); HashMap<String,OptionValueDescription> map = new HashMap<String,OptionValueDescription>(); for (OptionValueDescription description : result) { - map.put(description.getName(), description); + map.put(description.getOptionDefinition().getOptionName(), description); } assertOptionValue("alpha", "one", OptionPriority.COMMAND_LINE, "source", |