Lines Matching refs:expect

24 static void expect(const std::string& expr_str, const char* expected) {  in expect()  function
50 expect("a", "a"); in TEST_F()
51 expect("\"a\"", "a"); in TEST_F()
52 expect("\"\\x61\"", "a"); in TEST_F()
53 expect("# this is a comment\n" in TEST_F()
61 expect("a; b; c", "c"); in TEST_F()
66 expect("a + b", "ab"); in TEST_F()
67 expect("a + \n \"b\"", "ab"); in TEST_F()
68 expect("a + b +\nc\n", "abc"); in TEST_F()
71 expect("concat(a, b)", "ab"); in TEST_F()
72 expect("concat(a,\n \"b\")", "ab"); in TEST_F()
73 expect("concat(a + b,\nc,\"d\")", "abcd"); in TEST_F()
74 expect("\"concat\"(a + b,\nc,\"d\")", "abcd"); in TEST_F()
79 expect("a && b", "b"); in TEST_F()
80 expect("a && \"\"", ""); in TEST_F()
81 expect("\"\" && b", ""); in TEST_F()
82 expect("\"\" && \"\"", ""); in TEST_F()
83 expect("\"\" && abort()", ""); // test short-circuiting in TEST_F()
84 expect("t && abort()", nullptr); in TEST_F()
87 expect("a || b", "a"); in TEST_F()
88 expect("a || \"\"", "a"); in TEST_F()
89 expect("\"\" || b", "b"); in TEST_F()
90 expect("\"\" || \"\"", ""); in TEST_F()
91 expect("a || abort()", "a"); // test short-circuiting in TEST_F()
92 expect("\"\" || abort()", NULL); in TEST_F()
95 expect("!a", ""); in TEST_F()
96 expect("! \"\"", "t"); in TEST_F()
97 expect("!!a", "t"); in TEST_F()
102 expect("\"\" == \"\" && b", "b"); in TEST_F()
103 expect("a + b == ab", "t"); in TEST_F()
104 expect("ab == a + b", "t"); in TEST_F()
105 expect("a + (b == ab)", "a"); in TEST_F()
106 expect("(ab == a) + b", "b"); in TEST_F()
111 expect("is_substring(cad, abracadabra)", "t"); in TEST_F()
112 expect("is_substring(abrac, abracadabra)", "t"); in TEST_F()
113 expect("is_substring(dabra, abracadabra)", "t"); in TEST_F()
114 expect("is_substring(cad, abracxadabra)", ""); in TEST_F()
115 expect("is_substring(abrac, axbracadabra)", ""); in TEST_F()
116 expect("is_substring(dabra, abracadabrxa)", ""); in TEST_F()
121 expect("ifelse(t, yes, no)", "yes"); in TEST_F()
122 expect("ifelse(!t, yes, no)", "no"); in TEST_F()
123 expect("ifelse(t, yes, abort())", "yes"); in TEST_F()
124 expect("ifelse(!t, abort(), no)", "no"); in TEST_F()
129 expect("if t then yes else no endif", "yes"); in TEST_F()
130 expect("if \"\" then yes else no endif", "no"); in TEST_F()
131 expect("if \"\" then yes endif", ""); in TEST_F()
132 expect("if \"\"; t then yes endif", "yes"); in TEST_F()
137 expect("less_than_int(3, 14)", "t"); in TEST_F()
138 expect("less_than_int(14, 3)", ""); in TEST_F()
139 expect("less_than_int(x, 3)", ""); in TEST_F()
140 expect("less_than_int(3, x)", ""); in TEST_F()
141 expect("greater_than_int(3, 14)", ""); in TEST_F()
142 expect("greater_than_int(14, 3)", "t"); in TEST_F()
143 expect("greater_than_int(x, 3)", ""); in TEST_F()
144 expect("greater_than_int(3, x)", ""); in TEST_F()
148 expect(std::string(8192, 's'), std::string(8192, 's').c_str()); in TEST_F()