public void TestStringLiterals_DoubleQuotes_spr9620() { var expr = new SpelExpressionParser().ParseRaw("\"double quote: \"\".\""); Assert.Equal("double quote: \".", expr.GetValue()); expr = new SpelExpressionParser().ParseRaw("\"hello \"\" world\""); Assert.Equal("hello \" world", expr.GetValue()); }
public void StringLiterals() { var expr = new SpelExpressionParser().ParseRaw("'howdy'"); Assert.Equal("howdy", expr.GetValue()); expr = new SpelExpressionParser().ParseRaw("'hello '' world'"); Assert.Equal("hello ' world", expr.GetValue()); }
public void BooleanOperators_symbolic_spr9614() { var expr = new SpelExpressionParser().ParseRaw("true"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("false"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("false && false"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("true && (true || false)"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("true && true || false"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("!true"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("!(false || true)"); Assert.False(expr.GetValue <bool>()); }
public void BooleanOperators() { var expr = new SpelExpressionParser().ParseRaw("true"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("false"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("false and false"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("true and (true or false)"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("true and true or false"); Assert.True(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("!true"); Assert.False(expr.GetValue <bool>()); expr = new SpelExpressionParser().ParseRaw("!(false or true)"); Assert.False(expr.GetValue <bool>()); }
public void StringLiterals2() { var expr = new SpelExpressionParser().ParseRaw("'howdy'.Substring(0,2)"); Assert.Equal("ho", expr.GetValue()); }
public void ArithmeticPrecedence6() { var expr = new SpelExpressionParser().ParseRaw("(3+2)*2"); Assert.Equal(10, expr.GetValue()); }
public void ArithmeticPrecedence5() { var expr = new SpelExpressionParser().ParseRaw("(4+10)/2"); Assert.Equal(7, expr.GetValue()); }
public void ArithmeticPrecedence4() { var expr = new SpelExpressionParser().ParseRaw("10/2+3"); Assert.Equal(8, expr.GetValue()); }