@@ -76,6 +76,46 @@ var testCases = []struct {
7676 {Value : "'Redmond'" , Depth : 1 , Type : ExpressionTokenString },
7777 },
7878 },
79+ {
80+ expression : "case(false:0,true:1)" ,
81+ tree : []expectedParseNode {
82+ {Value : "case" , Depth : 0 , Type : ExpressionTokenCase },
83+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
84+ {Value : "false" , Depth : 2 , Type : ExpressionTokenBoolean },
85+ {Value : "0" , Depth : 2 , Type : ExpressionTokenInteger },
86+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
87+ {Value : "true" , Depth : 2 , Type : ExpressionTokenBoolean },
88+ {Value : "1" , Depth : 2 , Type : ExpressionTokenInteger },
89+ },
90+ },
91+ {
92+ expression : "case(prop eq 'one':1,true:0)" ,
93+ tree : []expectedParseNode {
94+ {Value : "case" , Depth : 0 , Type : ExpressionTokenCase },
95+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
96+ {Value : "eq" , Depth : 2 , Type : ExpressionTokenLogical },
97+ {Value : "prop" , Depth : 3 , Type : ExpressionTokenLiteral },
98+ {Value : "'one'" , Depth : 3 , Type : ExpressionTokenString },
99+ {Value : "1" , Depth : 2 , Type : ExpressionTokenInteger },
100+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
101+ {Value : "true" , Depth : 2 , Type : ExpressionTokenBoolean },
102+ {Value : "0" , Depth : 2 , Type : ExpressionTokenInteger },
103+ },
104+ },
105+ {
106+ expression : "case(contains(prop,'val'):0,true:1)" ,
107+ tree : []expectedParseNode {
108+ {Value : "case" , Depth : 0 , Type : ExpressionTokenCase },
109+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
110+ {Value : "contains" , Depth : 2 , Type : ExpressionTokenFunc },
111+ {Value : "prop" , Depth : 3 , Type : ExpressionTokenLiteral },
112+ {Value : "'val'" , Depth : 3 , Type : ExpressionTokenString },
113+ {Value : "0" , Depth : 2 , Type : ExpressionTokenInteger },
114+ {Value : "" , Depth : 1 , Type : ExpressionTokenCasePair },
115+ {Value : "true" , Depth : 2 , Type : ExpressionTokenBoolean },
116+ {Value : "1" , Depth : 2 , Type : ExpressionTokenInteger },
117+ },
118+ },
79119 {
80120 /*
81121 {
0 commit comments