Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: runtime/vm/json_test.cc

Issue 1162133002: Introduce Instance.kind. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: regis feedback Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/observatory/tests/service/get_retained_size_rpc_test.dart ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "platform/json.h" 6 #include "platform/json.h"
7 #include "vm/json_stream.h" 7 #include "vm/json_stream.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 293
294 TEST_CASE(JSON_JSONStream_DartObject) { 294 TEST_CASE(JSON_JSONStream_DartObject) {
295 JSONStream js; 295 JSONStream js;
296 { 296 {
297 JSONArray jsarr(&js); 297 JSONArray jsarr(&js);
298 jsarr.AddValue(Object::Handle(Object::null())); 298 jsarr.AddValue(Object::Handle(Object::null()));
299 JSONObject jsobj(&jsarr); 299 JSONObject jsobj(&jsarr);
300 jsobj.AddProperty("object_key", Object::Handle(Object::null())); 300 jsobj.AddProperty("object_key", Object::Handle(Object::null()));
301 } 301 }
302 EXPECT_STREQ("[{\"type\":\"@null\",\"fixedId\":true," 302 EXPECT_STREQ("[{\"type\":\"@Instance\","
303 "\"_vmType\":\"null\","
304 "\"kind\":\"Null\","
305 "\"fixedId\":true,"
303 "\"id\":\"objects\\/null\"," 306 "\"id\":\"objects\\/null\","
304 "\"valueAsString\":\"null\"}," 307 "\"valueAsString\":\"null\"},"
305 "{\"object_key\":{\"type\":\"@null\",\"fixedId\":true," 308 "{\"object_key\":"
309 "{\"type\":\"@Instance\","
310 "\"_vmType\":\"null\","
311 "\"kind\":\"Null\","
312 "\"fixedId\":true,"
306 "\"id\":\"objects\\/null\"," 313 "\"id\":\"objects\\/null\","
307 "\"valueAsString\":\"null\"}}]", 314 "\"valueAsString\":\"null\"}}]",
308 js.ToCString()); 315 js.ToCString());
309 } 316 }
310 317
311 TEST_CASE(JSON_JSONStream_EscapedString) { 318 TEST_CASE(JSON_JSONStream_EscapedString) {
312 JSONStream js; 319 JSONStream js;
313 { 320 {
314 JSONArray jsarr(&js); 321 JSONArray jsarr(&js);
315 jsarr.AddValue("Hel\"\"lo\r\n\t"); 322 jsarr.AddValue("Hel\"\"lo\r\n\t");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 js.SetParams(&param_keys[0], &param_values[0], 2); 408 js.SetParams(&param_keys[0], &param_values[0], 2);
402 EXPECT(js.num_params() == 2); 409 EXPECT(js.num_params() == 2);
403 EXPECT(!js.HasParam("lizard")); 410 EXPECT(!js.HasParam("lizard"));
404 EXPECT(js.HasParam("dog")); 411 EXPECT(js.HasParam("dog"));
405 EXPECT(js.HasParam("cat")); 412 EXPECT(js.HasParam("cat"));
406 EXPECT(js.ParamIs("cat", "banana")); 413 EXPECT(js.ParamIs("cat", "banana"));
407 EXPECT(!js.ParamIs("dog", "banana")); 414 EXPECT(!js.ParamIs("dog", "banana"));
408 } 415 }
409 416
410 } // namespace dart 417 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/get_retained_size_rpc_test.dart ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698