use of net.coderbot.iris.shaderpack.option.StringOption in project Iris by IrisShaders.
the class OptionDiscoverTest method testTrivialString.
private void testTrivialString(String base, String expectedOptionName, String expectedDefault, ImmutableList<String> expectedAllowed) {
OptionAnnotatedSource source = new OptionAnnotatedSource(base);
OptionSet options = source.getOptionSet(AbsolutePackPath.fromAbsolutePath("/<hardcoded>"), source.getBooleanDefineReferences().keySet());
Assertions.assertEquals(options.getBooleanOptions().size(), 0, "Unexpectedly discovered a boolean option");
if (options.getStringOptions().size() == 0) {
Assertions.fail("No string options were discovered, diagnostics: " + source.getDiagnostics());
}
StringOption option = options.getStringOptions().values().iterator().next().getOption();
Assertions.assertEquals(option.getName(), expectedOptionName);
Assertions.assertEquals(option.getDefaultValue(), expectedDefault);
Assertions.assertEquals(option.getAllowedValues(), expectedAllowed);
}
Aggregations