Lines Matching refs:actual

45 #define EXPECT_JSON_EQ(expected, actual) \  argument
46 EXPECT_PRED2(IsEqualValue, *ParseValue(expected), actual)
51 int actual; in TEST() local
52 EXPECT_TRUE(FromValue(*ParseValue("123"), &actual)); in TEST()
53 EXPECT_EQ(123, actual); in TEST()
55 EXPECT_TRUE(FromValue(*ParseValue("-123"), &actual)); in TEST()
56 EXPECT_EQ(-123, actual); in TEST()
58 EXPECT_FALSE(FromValue(*ParseValue("true"), &actual)); in TEST()
62 bool actual; in TEST() local
63 EXPECT_TRUE(FromValue(*ParseValue("false"), &actual)); in TEST()
64 EXPECT_FALSE(actual); in TEST()
66 EXPECT_TRUE(FromValue(*ParseValue("true"), &actual)); in TEST()
67 EXPECT_TRUE(actual); in TEST()
69 EXPECT_FALSE(FromValue(*ParseValue("0"), &actual)); in TEST()
70 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual)); in TEST()
74 double actual; in TEST() local
75 EXPECT_TRUE(FromValue(*ParseValue("12.5"), &actual)); in TEST()
76 EXPECT_DOUBLE_EQ(12.5, actual); in TEST()
78 EXPECT_TRUE(FromValue(*ParseValue("-0.1"), &actual)); in TEST()
79 EXPECT_DOUBLE_EQ(-0.1, actual); in TEST()
81 EXPECT_TRUE(FromValue(*ParseValue("17"), &actual)); in TEST()
82 EXPECT_DOUBLE_EQ(17.0, actual); in TEST()
84 EXPECT_FALSE(FromValue(*ParseValue("'1.0'"), &actual)); in TEST()
88 std::string actual; in TEST() local
89 EXPECT_TRUE(FromValue(*ParseValue("'foo'"), &actual)); in TEST()
90 EXPECT_EQ("foo", actual); in TEST()
92 EXPECT_TRUE(FromValue(*ParseValue("'bar'"), &actual)); in TEST()
93 EXPECT_EQ("bar", actual); in TEST()
95 EXPECT_TRUE(FromValue(*ParseValue("''"), &actual)); in TEST()
96 EXPECT_TRUE(actual.empty()); in TEST()
98 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual)); in TEST()
128 std::vector<int> actual; in TEST() local
129 EXPECT_TRUE(FromValue(*ParseValue("[1, 2, 3, 4]"), &actual)); in TEST()
130 EXPECT_EQ((std::vector<int>{1, 2, 3, 4}), actual); in TEST()
132 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
133 EXPECT_TRUE(actual.empty()); in TEST()
135 EXPECT_FALSE(FromValue(*ParseValue("[1, 2, 3, '4']"), &actual)); in TEST()
139 std::vector<bool> actual; in TEST() local
140 EXPECT_TRUE(FromValue(*ParseValue("[true, true, false]"), &actual)); in TEST()
141 EXPECT_EQ((std::vector<bool>{true, true, false}), actual); in TEST()
143 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
144 EXPECT_TRUE(actual.empty()); in TEST()
146 EXPECT_FALSE(FromValue(*ParseValue("[true, 0]"), &actual)); in TEST()
150 std::vector<double> actual; in TEST() local
151 EXPECT_TRUE(FromValue(*ParseValue("[1, 2.0, 6.5, -11.2]"), &actual)); in TEST()
152 EXPECT_EQ((std::vector<double>{1.0, 2.0, 6.5, -11.2}), actual); in TEST()
154 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
155 EXPECT_TRUE(actual.empty()); in TEST()
157 EXPECT_FALSE(FromValue(*ParseValue("['s']"), &actual)); in TEST()
161 std::vector<std::string> actual; in TEST() local
162 EXPECT_TRUE(FromValue(*ParseValue("['', 'foo', 'bar']"), &actual)); in TEST()
163 EXPECT_EQ((std::vector<std::string>{"", "foo", "bar"}), actual); in TEST()
165 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
166 EXPECT_TRUE(actual.empty()); in TEST()
168 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual)); in TEST()
172 std::vector<std::vector<int>> actual; in TEST() local
173 EXPECT_TRUE(FromValue(*ParseValue("[[1,2], [], [3]]"), &actual)); in TEST()
174 EXPECT_EQ((std::vector<std::vector<int>>{{1,2}, {}, {3}}), actual); in TEST()
176 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
177 EXPECT_TRUE(actual.empty()); in TEST()
179 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual)); in TEST()
183 std::map<std::string, int> actual; in TEST() local
184 EXPECT_TRUE(FromValue(*ParseValue("{'foo':1, 'bar':2, 'baz':3}"), &actual)); in TEST()
186 actual); in TEST()
188 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual)); in TEST()
189 EXPECT_TRUE(actual.empty()); in TEST()
191 EXPECT_FALSE(FromValue(*ParseValue("{'foo':1, 'bar':'2'}"), &actual)); in TEST()
195 std::map<std::string, std::vector<int>> actual; in TEST() local
196 EXPECT_TRUE(FromValue(*ParseValue("{'foo':[1,2], 'bar':[]}"), &actual)); in TEST()
199 EXPECT_EQ(expected, actual); in TEST()
201 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual)); in TEST()
202 EXPECT_TRUE(actual.empty()); in TEST()
204 EXPECT_FALSE(FromValue(*ParseValue("{'foo':[1], 'bar':[2,'3']}"), &actual)); in TEST()
208 std::vector<std::map<std::string, int>> actual; in TEST() local
209 EXPECT_TRUE(FromValue(*ParseValue("[{'foo':1,'bar':2},{'baz':3}]"), &actual)); in TEST()
212 EXPECT_EQ(expected, actual); in TEST()
214 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual)); in TEST()
215 EXPECT_TRUE(actual.empty()); in TEST()
217 EXPECT_FALSE(FromValue(*ParseValue("[{'foo':1}, 'bar']"), &actual)); in TEST()
221 std::vector<std::unique_ptr<base::ListValue>> actual; in TEST() local
222 EXPECT_TRUE(FromValue(*ParseValue("[['foo',1],['bar',2],[true]]"), &actual)); in TEST()
223 ASSERT_EQ(3, actual.size()); in TEST()
224 EXPECT_JSON_EQ("['foo', 1]", *actual[0]); in TEST()
225 EXPECT_JSON_EQ("['bar', 2]", *actual[1]); in TEST()
226 EXPECT_JSON_EQ("[true]", *actual[2]); in TEST()
230 std::vector<std::unique_ptr<base::DictionaryValue>> actual; in TEST() local
231 EXPECT_TRUE(FromValue(*ParseValue("[{'foo': 1}, {'bar': 2}]"), &actual)); in TEST()
232 ASSERT_EQ(2, actual.size()); in TEST()
233 EXPECT_JSON_EQ("{'foo': 1}", *actual[0]); in TEST()
234 EXPECT_JSON_EQ("{'bar': 2}", *actual[1]); in TEST()