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

Side by Side Diff: tests/language/src/NumberSyntaxTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class NumberSyntaxTest {
6
7 static void testMain() {
8 testShortDoubleSyntax();
9 testDotSelectorSyntax();
10 }
11
12 static void testShortDoubleSyntax() {
13 Expect.equals(0.0, .0);
14 Expect.equals(0.5, .5);
15 Expect.equals(0.1234, .1234);
16 }
17
18 static void testDotSelectorSyntax() {
19 // Integers.
20 Expect.equals(0, 0.dynamic);
21 Expect.equals(1, 1.dynamic);
22 Expect.equals(123, 123.dynamic);
23 Expect.equals('0', 0.toString());
24 Expect.equals('1', 1.toString());
25 Expect.equals('123', 123.toString());
26
27 Expect.equals(0, 0 .dynamic);
28 Expect.equals(1, 1 .dynamic);
29 Expect.equals(123, 123 .dynamic);
30 Expect.equals('0', 0 .toString());
31 Expect.equals('1', 1 .toString());
32 Expect.equals('123', 123 .toString());
33
34 Expect.equals(0, 0. dynamic);
35 Expect.equals(1, 1. dynamic);
36 Expect.equals(123, 123. dynamic);
37 Expect.equals('0', 0. toString());
38 Expect.equals('1', 1. toString());
39 Expect.equals('123', 123. toString());
40
41 // Doubles.
42 Expect.equals(0.0, 0.0.dynamic);
43 Expect.equals(0.1, .1.dynamic);
44 Expect.equals(1.1, 1.1.dynamic);
45 Expect.equals(123.4, 123.4.dynamic);
46 Expect.equals((0.0).toString(), 0.0.toString());
47 Expect.equals((0.1).toString(), .1.toString());
48 Expect.equals((1.1).toString(), 1.1.toString());
49 Expect.equals((123.4).toString(), 123.4.toString());
50
51 Expect.equals(0.0, 0.0 .dynamic);
52 Expect.equals(0.1, .1.dynamic);
53 Expect.equals(1.1, 1.1 .dynamic);
54 Expect.equals(123.4, 123.4 .dynamic);
55 Expect.equals((0.0).toString(), 0.0 .toString());
56 Expect.equals((0.1).toString(), .1 .toString());
57 Expect.equals((1.1).toString(), 1.1 .toString());
58 Expect.equals((123.4).toString(), 123.4 .toString());
59
60 Expect.equals(0.0, 0.0. dynamic);
61 Expect.equals(0.1, .1.dynamic);
62 Expect.equals(1.1, 1.1. dynamic);
63 Expect.equals(123.4, 123.4. dynamic);
64 Expect.equals((0.0).toString(), 0.0. toString());
65 Expect.equals((0.1).toString(), .1. toString());
66 Expect.equals((1.1).toString(), 1.1. toString());
67 Expect.equals((123.4).toString(), 123.4. toString());
68
69 // Exponent notation.
70 Expect.equals(0e0, 0e0.dynamic);
71 Expect.equals(1e+1, 1e+1.dynamic);
72 Expect.equals(2.1e-34, 2.1e-34.dynamic);
73 Expect.equals((0e0).toString(), 0e0.toString());
74 Expect.equals((1e+1).toString(), 1e+1.toString());
75 Expect.equals((2.1e-34).toString(), 2.1e-34.toString());
76 }
77
78 }
79 main() {
80 NumberSyntaxTest.testMain();
81 }
OLDNEW
« no previous file with comments | « tests/language/src/NumberIdentifierNegativeTest.dart ('k') | tests/language/src/NumbersTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698