Skip to content

Commit

Permalink
Adds Option parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed Feb 13, 2024
1 parent ea127bd commit d5551bb
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Test;

import com.fathzer.jchess.bot.Option;
import com.fathzer.jchess.bot.options.ComboOption;
import com.fathzer.jchess.bot.options.SpinOption;
import com.fathzer.jchess.bot.options.StringOption;

Expand All @@ -31,8 +32,12 @@ void test() {
assertEquals("Book Directory", option.getName());
assertEquals("C:\\Program Files (x86)\\Arena\\Engines\\Dragon", option.getValue());


fail("Not yet implemented");
ooption = OptionParser.parse("option name x default a b var c var a b type combo");
assertTrue(ooption.isPresent());
ComboOption combo = (ComboOption) ooption.get();
assertEquals("x", combo.getName());
assertEquals("a b", combo.getValue());
assertTrue(combo.getValues().contains("c"));
}

}

0 comments on commit d5551bb

Please sign in to comment.