Lines Matching refs:root

25   std::unique_ptr<Value> root = JSONReader().ReadToValue("   null   ");  in TEST()  local
26 ASSERT_TRUE(root); in TEST()
27 EXPECT_TRUE(root->is_none()); in TEST()
35 std::unique_ptr<Value> root = JSONReader().ReadToValue("true "); in TEST() local
36 ASSERT_TRUE(root); in TEST()
37 EXPECT_TRUE(root->is_bool()); in TEST()
41 std::unique_ptr<Value> root = JSONReader().ReadToValue("/* comment */null"); in TEST() local
42 ASSERT_TRUE(root); in TEST()
43 EXPECT_TRUE(root->is_none()); in TEST()
44 root = JSONReader().ReadToValue("40 /* comment */"); in TEST()
45 ASSERT_TRUE(root); in TEST()
46 EXPECT_TRUE(root->is_int()); in TEST()
47 root = JSONReader().ReadToValue("true // comment"); in TEST()
48 ASSERT_TRUE(root); in TEST()
49 EXPECT_TRUE(root->is_bool()); in TEST()
50 root = JSONReader().ReadToValue("/* comment */\"sample string\""); in TEST()
51 ASSERT_TRUE(root); in TEST()
52 EXPECT_TRUE(root->is_string()); in TEST()
54 EXPECT_TRUE(root->GetAsString(&value)); in TEST()
68 root = JSONReader().ReadToValue("/* comment **/42"); in TEST()
69 ASSERT_TRUE(root); in TEST()
70 EXPECT_TRUE(root->is_int()); in TEST()
71 EXPECT_TRUE(root->GetAsInteger(&int_val)); in TEST()
73 root = JSONReader().ReadToValue( in TEST()
77 ASSERT_TRUE(root); in TEST()
78 EXPECT_TRUE(root->is_int()); in TEST()
79 EXPECT_TRUE(root->GetAsInteger(&int_val)); in TEST()
84 std::unique_ptr<Value> root = JSONReader().ReadToValue("43"); in TEST() local
85 ASSERT_TRUE(root); in TEST()
86 EXPECT_TRUE(root->is_int()); in TEST()
88 EXPECT_TRUE(root->GetAsInteger(&int_val)); in TEST()
102 std::unique_ptr<Value> root = JSONReader().ReadToValue("0"); in TEST() local
103 ASSERT_TRUE(root); in TEST()
104 EXPECT_TRUE(root->is_int()); in TEST()
106 EXPECT_TRUE(root->GetAsInteger(&int_val)); in TEST()
113 std::unique_ptr<Value> root = JSONReader().ReadToValue("2147483648"); in TEST() local
114 ASSERT_TRUE(root); in TEST()
116 EXPECT_TRUE(root->is_double()); in TEST()
118 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
120 root = JSONReader().ReadToValue("-2147483649"); in TEST()
121 ASSERT_TRUE(root); in TEST()
122 EXPECT_TRUE(root->is_double()); in TEST()
124 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
129 std::unique_ptr<Value> root = JSONReader().ReadToValue("43.1"); in TEST() local
130 ASSERT_TRUE(root); in TEST()
131 EXPECT_TRUE(root->is_double()); in TEST()
133 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
136 root = JSONReader().ReadToValue("4.3e-1"); in TEST()
137 ASSERT_TRUE(root); in TEST()
138 EXPECT_TRUE(root->is_double()); in TEST()
140 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
143 root = JSONReader().ReadToValue("2.1e0"); in TEST()
144 ASSERT_TRUE(root); in TEST()
145 EXPECT_TRUE(root->is_double()); in TEST()
147 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
150 root = JSONReader().ReadToValue("2.1e+0001"); in TEST()
151 ASSERT_TRUE(root); in TEST()
152 EXPECT_TRUE(root->is_double()); in TEST()
154 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
157 root = JSONReader().ReadToValue("0.01"); in TEST()
158 ASSERT_TRUE(root); in TEST()
159 EXPECT_TRUE(root->is_double()); in TEST()
161 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
164 root = JSONReader().ReadToValue("1.00"); in TEST()
165 ASSERT_TRUE(root); in TEST()
166 EXPECT_TRUE(root->is_double()); in TEST()
168 EXPECT_TRUE(root->GetAsDouble(&double_val)); in TEST()
202 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"hello world\""); in TEST() local
203 ASSERT_TRUE(root); in TEST()
204 EXPECT_TRUE(root->is_string()); in TEST()
206 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
211 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"\""); in TEST() local
212 ASSERT_TRUE(root); in TEST()
213 EXPECT_TRUE(root->is_string()); in TEST()
215 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
220 std::unique_ptr<Value> root = in TEST() local
222 ASSERT_TRUE(root); in TEST()
223 EXPECT_TRUE(root->is_string()); in TEST()
225 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
231 std::unique_ptr<Value> root = in TEST() local
233 ASSERT_TRUE(root); in TEST()
234 EXPECT_TRUE(root->is_string()); in TEST()
236 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
461 std::unique_ptr<Value> root = in TEST() local
463 ASSERT_TRUE(root); in TEST()
464 EXPECT_TRUE(root->is_string()); in TEST()
466 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
484 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"\\u20ac3,14\""); in TEST() local
485 ASSERT_TRUE(root); in TEST()
486 EXPECT_TRUE(root->is_string()); in TEST()
488 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
494 root = JSONReader().ReadToValue("\"\\ud83d\\udca9\\ud83d\\udc6c\""); in TEST()
495 ASSERT_TRUE(root); in TEST()
496 EXPECT_TRUE(root->is_string()); in TEST()
498 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
517 std::unique_ptr<Value> root; in TEST() local
519 root = JSONReader().ReadToValue(cases[i]); in TEST()
520 EXPECT_FALSE(root) << cases[i]; in TEST()
525 std::unique_ptr<Value> root = JSONReader::Read("null"); in TEST() local
526 ASSERT_TRUE(root); in TEST()
527 EXPECT_TRUE(root->is_none()); in TEST()
529 root = JSONReader::Read("true"); in TEST()
530 ASSERT_TRUE(root); in TEST()
532 EXPECT_TRUE(root->GetAsBoolean(&bool_value)); in TEST()
535 root = JSONReader::Read("10"); in TEST()
536 ASSERT_TRUE(root); in TEST()
538 EXPECT_TRUE(root->GetAsInteger(&integer_value)); in TEST()
541 root = JSONReader::Read("\"root\""); in TEST()
542 ASSERT_TRUE(root); in TEST()
544 EXPECT_TRUE(root->GetAsString(&str_val)); in TEST()
558 std::unique_ptr<Value> root(reader.ReadToValue(input)); in TEST() local
559 ASSERT_TRUE(root) << reader.GetErrorMessage(); in TEST()
560 EXPECT_TRUE(root->is_dict()); in TEST()
574 std::unique_ptr<Value> root = JSONReader::Read( in TEST() local
588 ASSERT_TRUE(root); in TEST()
591 ASSERT_TRUE(root->GetAsDictionary(&root_dict)); in TEST()
658 std::unique_ptr<Value> root; in TEST() local
659 root = JSONReader::Read(json, JSON_PARSE_RFC, 3); in TEST()
660 ASSERT_FALSE(root); in TEST()
661 root = JSONReader::Read(json, JSON_PARSE_RFC, 4); in TEST()
662 ASSERT_TRUE(root); in TEST()