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: 564407730
  • Loading branch information
cushon authored and Error Prone Team committed Sep 11, 2023
1 parent 5e9ae5e commit c6ba9f4
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 c6ba9f4

Please sign in to comment.