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

Side by Side Diff: tests/lib/convert/json_lib_test.dart

Issue 2656743002: Remove package:unittest from some tests (Closed)
Patch Set: Created 3 years, 10 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 | « tests/lib/async/timer_test.dart ('k') | tests/lib/math/point_test.dart » ('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) 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 import 'package:unittest/unittest.dart'; 6 import 'package:test/test.dart';
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 main() { 9 main() {
10 test('Parse', () { 10 test('Parse', () {
11 // Scalars. 11 // Scalars.
12 expect(JSON.decode(' 5 '), equals(5)); 12 expect(JSON.decode(' 5 '), equals(5));
13 expect(JSON.decode(' -42 '), equals(-42)); 13 expect(JSON.decode(' -42 '), equals(-42));
14 expect(JSON.decode(' 3e0 '), equals(3)); 14 expect(JSON.decode(' 3e0 '), equals(3));
15 expect(JSON.decode(' 3.14 '), equals(3.14)); 15 expect(JSON.decode(' 3.14 '), equals(3.14));
16 expect(JSON.decode('true '), isTrue); 16 expect(JSON.decode('true '), isTrue);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 var throwsJsonError = 179 var throwsJsonError =
180 throwsA(new isInstanceOf<JsonUnsupportedObjectError>()); 180 throwsA(new isInstanceOf<JsonUnsupportedObjectError>());
181 181
182 /** 182 /**
183 * Checks that the argument can be converted to a JSON string and 183 * Checks that the argument can be converted to a JSON string and
184 * back, and produce something equivalent to the argument. 184 * back, and produce something equivalent to the argument.
185 */ 185 */
186 validateRoundTrip(expected) { 186 validateRoundTrip(expected) {
187 expect(JSON.decode(JSON.encode(expected)), equals(expected)); 187 expect(JSON.decode(JSON.encode(expected)), equals(expected));
188 } 188 }
OLDNEW
« no previous file with comments | « tests/lib/async/timer_test.dart ('k') | tests/lib/math/point_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698