use of com.bakdata.conquery.models.preproc.parser.specific.StringParser in project conquery by bakdata.
the class StringEncodingTest method testHexStreamStringType.
@Test
public void testHexStreamStringType() {
StringParser parser = new StringParser(new ConqueryConfig());
Stream.generate(() -> UUID.randomUUID().toString().replace("-", "")).map(String::toUpperCase).mapToInt(v -> {
try {
return parser.parse(v);
} catch (ParsingException e) {
// We know that StringTypeVarInt is able to parse our strings.
return 0;
}
}).limit(100).forEach(parser::addLine);
StringTypeEncoded subType = (StringTypeEncoded) parser.findBestType();
assertThat(subType).isInstanceOf(StringTypeEncoded.class);
assertThat(subType.getEncoding()).isEqualByComparingTo(StringTypeEncoded.Encoding.Base16UpperCase);
}
Aggregations