diff options
author | ccalvarin <ccalvarin@google.com> | 2018-04-09 08:44:02 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-09 08:45:29 -0700 |
commit | aa98bc29dae14119797febd447302842f4ac68af (patch) | |
tree | a159cd823e7a7861586cb381a201ab3e1b6c40fd /src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java | |
parent | 6b5aa72d63137b3051f47e9ddd48781fab12fa6a (diff) |
Remove alphabetical sorting of options in the canonical list.
This was broken for --config. Doing this properly requires keeping the order in which the options were given, which could be done either by filtering the ordered list according to which values affect the final outcome or by tracking the order correctly. I picked the later: the option order was not explicitly tracked for expansions before but now it is.
RELNOTES: canonicalize-flags no longer reorders the flags
PiperOrigin-RevId: 192132260
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java index fc51f94f9a..6c7f2929f1 100644 --- a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java +++ b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java @@ -283,16 +283,16 @@ public class CommandLineEventTest { assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze"); assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2); assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName"); - // In the canonical line, expect the options in alphabetical order. + // In the canonical line, expect the options in priority order. assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(4); assertThat(line.getSections(3).getOptionList().getOption(0).getCombinedForm()) - .isEqualTo("--expanded_c=2"); - assertThat(line.getSections(3).getOptionList().getOption(1).getCombinedForm()) .isEqualTo("--test_multiple_string=baz"); + assertThat(line.getSections(3).getOptionList().getOption(1).getCombinedForm()) + .isEqualTo("--test_string=foo"); assertThat(line.getSections(3).getOptionList().getOption(2).getCombinedForm()) .isEqualTo("--test_multiple_string=bar"); assertThat(line.getSections(3).getOptionList().getOption(3).getCombinedForm()) - .isEqualTo("--test_string=foo"); + .isEqualTo("--expanded_c=2"); assertThat(line.getSections(4).getChunkList().getChunkCount()).isEqualTo(0); } |