parseCommentedOutEnumWithoutExplicitValues
This commit is contained in:
parent
bc7739de29
commit
7540f4f6cc
|
@ -227,4 +227,34 @@ public class EnumToStringTest {
|
|||
"}\n", java);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void parseCommentedOutEnumWithoutExplicitValues() throws IOException {
|
||||
final StringReader reader = new StringReader(
|
||||
"typedef enum {\n" +
|
||||
"\t//GPIO_UNASSIGNED,\n" +
|
||||
"\tGPIO_INVALID,\n" +
|
||||
"\tGPIO_HEX,\n" +
|
||||
"}brain_pin_e; // hello");
|
||||
EnumsReader enumsReader = new EnumsReader().read(reader);
|
||||
|
||||
VariableRegistry registry = new VariableRegistry();
|
||||
|
||||
for (Map.Entry<String /*enum name*/, EnumsReader.EnumState> e : enumsReader.getEnums().entrySet()) {
|
||||
|
||||
String a = ToJavaEnum.generate(registry, e.getKey(), e.getValue());
|
||||
|
||||
assertEquals("package com.rusefi.enums;\n" +
|
||||
"//auto-generated by ToJavaEnum.java\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"public enum brain_pin_e {\n" +
|
||||
"\tGPIO_INVALID,\n" +
|
||||
"\tGPIO_HEX,\n" +
|
||||
"}\n", a);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue