Skip to content

Commit

Permalink
Double-check that -XepOpt:BooleanFlag and `-XepOpt:BooleanFlag=true…
Browse files Browse the repository at this point in the history
…` are equivalent

PiperOrigin-RevId: 563869006
  • Loading branch information
cushon authored and Error Prone Team committed Sep 11, 2023
1 parent 593f1f1 commit 27e7dff
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public void parseAndGetBoolean() {
.parseFlag("-XepOpt:Arg1=tRuE")
.parseFlag("-XepOpt:Arg2=FaLsE")
.parseFlag("-XepOpt:Arg3=yes")
.parseFlag("-XepOpt:Arg4")
.build();
assertThat(flags.getBoolean("Arg1")).hasValue(true);
assertThat(flags.getBoolean("Arg2")).hasValue(false);
assertThrows(IllegalArgumentException.class, () -> flags.getBoolean("Arg3"));
assertThat(flags.getBoolean("Arg4")).hasValue(true);
assertThat(flags.getBoolean("absent")).isEmpty();
}

Expand Down

0 comments on commit 27e7dff

Please sign in to comment.