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

Side by Side Diff: client/tests/client/json/json_tests.dart

Issue 9537001: Generate dart:html bindings for Dartium as well as Frog. All unittests now pass (or are disabled fo… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library('json_tests'); 5 #library('json_tests');
6 6
7 #import('dart:json'); 7 #import('dart:json');
8 #import('dart:html'); 8 #import('dart:html');
9 #import('../../../testing/unittest/unittest.dart'); 9 #import('../../../testing/unittest/unittest_dom.dart');
10 10
11 main() { 11 main() {
12 test('Parse', () { 12 test('Parse', () {
13 // Scalars. 13 // Scalars.
14 expect(JSON.parse(' 5 ')).equals(5); 14 expect(JSON.parse(' 5 ')).equals(5);
15 expect(JSON.parse(' -42 ')).equals(-42); 15 expect(JSON.parse(' -42 ')).equals(-42);
16 expect(JSON.parse(' 3e0 ')).equals(3); 16 expect(JSON.parse(' 3e0 ')).equals(3);
17 expect(JSON.parse(' 3.14 ')).equals(3.14); 17 expect(JSON.parse(' 3.14 ')).equals(3.14);
18 expect(JSON.parse('true ')).equals(true); 18 expect(JSON.parse('true ')).equals(true);
19 expect(JSON.parse(' false')).equals(false); 19 expect(JSON.parse(' false')).equals(false);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 expectIsContained(Map expected, Map actual, 161 expectIsContained(Map expected, Map actual,
162 [String message = '', bool checkValues = true]) { 162 [String message = '', bool checkValues = true]) {
163 for (final key in expected.getKeys()) { 163 for (final key in expected.getKeys()) {
164 expect(actual.containsKey(key)).equals(true); 164 expect(actual.containsKey(key)).equals(true);
165 if (checkValues) { 165 if (checkValues) {
166 expectValueEquals(expected[key], actual[key],'at key ${key} ${message}'); 166 expectValueEquals(expected[key], actual[key],'at key ${key} ${message}');
167 } 167 }
168 } 168 }
169 } 169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698