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

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

Issue 391003005: Update test expectation for Safari to account for JSON.parse bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | tests/lib/lib.status » ('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 library json_test; 5 library json_test;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "dart:convert"; 8 import "dart:convert";
9 9
10 bool badFormat(e) => e is FormatException; 10 bool badFormat(e) => e is FormatException;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 for (var expval in ["0", "1", "200"]) { 75 for (var expval in ["0", "1", "200"]) {
76 exponentList.add("$exphead$expval"); 76 exponentList.add("$exphead$expval");
77 } 77 }
78 } 78 }
79 79
80 for (var integer in integerList) { 80 for (var integer in integerList) {
81 for (var sign in signList) { 81 for (var sign in signList) {
82 for (var fraction in fractionList) { 82 for (var fraction in fractionList) {
83 for (var exp in exponentList) { 83 for (var exp in exponentList) {
84 var literal = "$sign$integer$fraction$exp"; 84 var literal = "$sign$integer$fraction$exp";
85 var parseNumber = 85 var expectedValue = num.parse(literal);
86 ((fraction == "" && exp == "") ? (String x) => int.parse(x)
87 : (String x) => double.parse(x));
88 var expectedValue = parseNumber(literal);
89 testJson(literal, expectedValue); 86 testJson(literal, expectedValue);
90 } 87 }
91 } 88 }
92 } 89 }
93 } 90 }
94 91
95 // Negative tests (syntax error). 92 // Negative tests (syntax error).
96 // testError thoroughly tests the given parts with a lot of valid 93 // testError thoroughly tests the given parts with a lot of valid
97 // values for the other parts. 94 // values for the other parts.
98 testError({signs, integers, fractions, exponents}) { 95 testError({signs, integers, fractions, exponents}) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 285 }
289 286
290 main() { 287 main() {
291 testNumbers(); 288 testNumbers();
292 testStrings(); 289 testStrings();
293 testWords(); 290 testWords();
294 testObjects(); 291 testObjects();
295 testArrays(); 292 testArrays();
296 testWhitespace(); 293 testWhitespace();
297 } 294 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698