use of org.drools.drl.parser.lang.dsl.DSLMappingEntry in project drools by kiegroup.
the class DSLMappingEntryTest method testExpandSpaces.
@Test
public void testExpandSpaces() throws IOException {
DSLMappingEntry entry = this.setupEntry();
DefaultExpander ex = makeExpander(entry);
String[] strs = new String[] { "0_sp", " 1_sp", " 3_sp", "0_sp_1 ", "0_sp_3 ", "0_sp 1_sp 2_sp", " 3_sp 3_sp 1_sp 1_sp_2 " };
StringBuilder sb = new StringBuilder("rule x\n" + "when\n");
for (String str : strs) {
sb.append("String is \"" + str + "\"" + NL);
}
sb.append("then\n" + "end\n");
String dslr = sb.toString();
String drl = ex.expand(dslr);
for (String str : strs) {
assertTrue(drl.contains('"' + str + '"'));
}
}
Aggregations