use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testParseCclValueWithoutQuotesAnd.
@Test
public void testParseCclValueWithoutQuotesAnd() {
String ccl = "name = jeff nelson and favorite_player != Lebron James";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
Assert.assertEquals(3, symbols.size());
for (int i = 0; i < 2; ++i) {
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
Assert.assertTrue(expr.values().get(0).value().toString().contains(" "));
}
}
use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testParseCclValueAndTimestampPhraseWithoutQuotesAnd.
@Test
public void testParseCclValueAndTimestampPhraseWithoutQuotesAnd() {
String ccl = "name = jeff nelson on last christmas day and favorite_player != Lebron James during last week";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
Assert.assertEquals(3, symbols.size());
for (int i = 0; i < 2; ++i) {
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
Assert.assertTrue(expr.values().get(0).value().toString().contains(" "));
// this means a
Assert.assertNotEquals(0, expr.raw().timestamp());
// timestamp was
// parsed
}
}
use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testReproGH_113.
@Test
public void testReproGH_113() {
String ccl = "location = \"Atlanta (HQ)\"";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
Assert.assertEquals(1, symbols.size());
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
Assert.assertEquals("Atlanta (HQ)", expr.raw().values().get(0));
}
use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testParseCclValueAndTimestampPhraseWithoutQuotes.
@Test
public void testParseCclValueAndTimestampPhraseWithoutQuotes() {
String ccl = "name = jeff nelson on last christmas day";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
Assert.assertEquals("jeff nelson", expr.values().get(0).value());
// this means a
Assert.assertNotEquals(0, expr.raw().timestamp());
// timestamp was
// parsed
}
use of com.cinchapi.ccl.grammar.PostfixNotationSymbol in project concourse by cinchapi.
the class ConcourseCompilerTest method testParseCclTimestampBasicPhrase.
@Test
public void testParseCclTimestampBasicPhrase() {
String ccl = "name = jeff at \"now\"";
Queue<PostfixNotationSymbol> symbols = ConcourseCompiler.get().arrange((ConditionTree) ConcourseCompiler.get().parse(ccl));
ExpressionSymbol expr = (ExpressionSymbol) symbols.poll();
// this means a
Assert.assertNotEquals(0, expr.raw().timestamp());
// timestamp was
// parsed
}
Aggregations