Home | History | Annotate | Download | only in brillo

Lines Matching refs:ParseValue

30 std::unique_ptr<base::Value> ParseValue(std::string json) {
46 EXPECT_PRED2(IsEqualValue, *ParseValue(expected), actual)
52 EXPECT_TRUE(FromValue(*ParseValue("123"), &actual));
55 EXPECT_TRUE(FromValue(*ParseValue("-123"), &actual));
58 EXPECT_FALSE(FromValue(*ParseValue("true"), &actual));
63 EXPECT_TRUE(FromValue(*ParseValue("false"), &actual));
66 EXPECT_TRUE(FromValue(*ParseValue("true"), &actual));
69 EXPECT_FALSE(FromValue(*ParseValue("0"), &actual));
70 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual));
75 EXPECT_TRUE(FromValue(*ParseValue("12.5"), &actual));
78 EXPECT_TRUE(FromValue(*ParseValue("-0.1"), &actual));
81 EXPECT_TRUE(FromValue(*ParseValue("17"), &actual));
84 EXPECT_FALSE(FromValue(*ParseValue("'1.0'"), &actual));
89 EXPECT_TRUE(FromValue(*ParseValue("'foo'"), &actual));
92 EXPECT_TRUE(FromValue(*ParseValue("'bar'"), &actual));
95 EXPECT_TRUE(FromValue(*ParseValue("''"), &actual));
98 EXPECT_FALSE(FromValue(*ParseValue("1"), &actual));
103 auto in_value = ParseValue("[1, 2, 'foo']");
110 auto in_value = ParseValue("{'foo':'bar','baz': 1}");
117 EXPECT_TRUE(FromValue(*ParseValue("[1, 2, 'bar']"), &list));
123 EXPECT_TRUE(FromValue(*ParseValue("{'foo':'bar','baz': 1}"), &dict));
129 EXPECT_TRUE(FromValue(*ParseValue("[1, 2, 3, 4]"), &actual));
132 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
135 EXPECT_FALSE(FromValue(*ParseValue("[1, 2, 3, '4']"), &actual));
140 EXPECT_TRUE(FromValue(*ParseValue("[true, true, false]"), &actual));
143 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
146 EXPECT_FALSE(FromValue(*ParseValue("[true, 0]"), &actual));
151 EXPECT_TRUE(FromValue(*ParseValue("[1, 2.0, 6.5, -11.2]"), &actual));
154 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
157 EXPECT_FALSE(FromValue(*ParseValue("['s']"), &actual));
162 EXPECT_TRUE(FromValue(*ParseValue("['', 'foo', 'bar']"), &actual));
165 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
168 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual));
173 EXPECT_TRUE(FromValue(*ParseValue("[[1,2], [], [3]]"), &actual));
176 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
179 EXPECT_FALSE(FromValue(*ParseValue("[100]"), &actual));
184 EXPECT_TRUE(FromValue(*ParseValue("{'foo':1, 'bar':2, 'baz':3}"), &actual));
188 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual));
191 EXPECT_FALSE(FromValue(*ParseValue("{'foo':1, 'bar':'2'}"), &actual));
196 EXPECT_TRUE(FromValue(*ParseValue("{'foo':[1,2], 'bar':[]}"), &actual));
201 EXPECT_TRUE(FromValue(*ParseValue("{}"), &actual));
204 EXPECT_FALSE(FromValue(*ParseValue("{'foo':[1], 'bar':[2,'3']}"), &actual));
209 EXPECT_TRUE(FromValue(*ParseValue("[{'foo':1,'bar':2},{'baz':3}]"), &actual));
214 EXPECT_TRUE(FromValue(*ParseValue("[]"), &actual));
217 EXPECT_FALSE(FromValue(*ParseValue("[{'foo':1}, 'bar']"), &actual));
222 EXPECT_TRUE(FromValue(*ParseValue("[['foo',1],['bar',2],[true]]"), &actual));
231 EXPECT_TRUE(FromValue(*ParseValue("[{'foo': 1}, {'bar': 2}]"), &actual));