Exemplo n.º 1
0
 @Test
 public void
     evaluatingAParsedCoalesceExpression_NullAndAStringWithQuotationMarks_RetunsQuotationMarks()
         throws Exception {
   Expression e = Coalesce.parse("null ?? \"\\\"\\\"\\\"\\\"\"");
   assertThat(e.evaluate(), is(equalTo("\\\"\\\"\\\"\\\"")));
 }
Exemplo n.º 2
0
 @Test
 public void evaluatingAParsedCoalesceExpression_AAndB_RetunsA() throws Exception {
   Expression e = Coalesce.parse("\"a\" ?? \"b\"");
   assertThat(e.evaluate(), is(equalTo("a")));
 }
Exemplo n.º 3
0
 @Test
 public void parseCoalesceExpression_AAndB_RightConstantIsB() {
   Coalesce e = Coalesce.parse("\"a\" ?? \"b\"");
   Constant constant = (Constant) e.getRight();
   assertThat(constant.getValue(), is(equalTo("b")));
 }