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