use of com.questdb.std.str.StringSink in project questdb by bluestreak01.
the class Lexer2Test method testQuotedToken.
@Test
public void testQuotedToken() {
Lexer2 ts = new Lexer2();
ts.defineSymbol("+");
ts.defineSymbol("++");
ts.defineSymbol("*");
ts.setContent("a+\"b\"*abc");
StringSink sink = new StringSink();
for (CharSequence cs : ts) {
sink.put(cs);
}
TestUtils.assertEquals("a+\"b\"*abc", sink);
}
use of com.questdb.std.str.StringSink in project questdb by bluestreak01.
the class Lexer2Test method testSymbolLookup.
@Test
public void testSymbolLookup() {
Lexer2 ts = new Lexer2();
ts.defineSymbol("+");
ts.defineSymbol("++");
ts.defineSymbol("*");
CharSequence content;
ts.setContent(content = "+*a+b++blah-");
StringSink sink = new StringSink();
for (CharSequence cs : ts) {
sink.put(cs);
}
TestUtils.assertEquals(content, sink);
}
use of com.questdb.std.str.StringSink in project questdb by bluestreak01.
the class LexerTest method testSingleQuotedToken.
@Test
public void testSingleQuotedToken() {
Lexer ts = new Lexer();
ts.defineSymbol("+");
ts.defineSymbol("++");
ts.defineSymbol("*");
ts.setContent("a+'b'*abc");
StringSink sink = new StringSink();
for (CharSequence cs : ts) {
sink.put(cs);
}
TestUtils.assertEquals("a+'b'*abc", sink);
}
use of com.questdb.std.str.StringSink in project questdb by bluestreak01.
the class LexerTest method testBlockComments.
@Test
public void testBlockComments() {
Lexer lex = new Lexer();
lex.defineSymbol("+");
lex.defineSymbol("++");
lex.defineSymbol("*");
lex.defineSymbol("/*");
lex.defineSymbol("*/");
lex.setContent("a + /* ok, this /* is a */ comment */ 'b' * abc");
StringSink sink = new StringSink();
while (lex.hasNext()) {
sink.put(lex.optionTok());
}
TestUtils.assertEquals("a+'b'*abc", sink);
}
use of com.questdb.std.str.StringSink in project questdb by bluestreak01.
the class LexerTest method testLineComment.
@Test
public void testLineComment() {
Lexer lex = new Lexer();
lex.defineSymbol("+");
lex.defineSymbol("++");
lex.defineSymbol("*");
lex.defineSymbol("/*");
lex.defineSymbol("*/");
lex.defineSymbol("--");
lex.setContent("a + -- ok, this is a comment \n 'b' * abc");
StringSink sink = new StringSink();
while (lex.hasNext()) {
sink.put(lex.optionTok());
}
TestUtils.assertEquals("a+'b'*abc", sink);
}
Aggregations