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

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/CoreRuntimeTypesTest.dart

Issue 11227042: isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 1 month 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 /** 5 /**
6 * A test of simple runtime behavior on numbers, strings and arrays with 6 * A test of simple runtime behavior on numbers, strings and arrays with
7 * a focus on both correct behavior and runtime errors. 7 * a focus on both correct behavior and runtime errors.
8 * 8 *
9 * This file is written to use minimal type declarations to match a 9 * This file is written to use minimal type declarations to match a
10 * typical dynamic language coding style. 10 * typical dynamic language coding style.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 assertEquals(x.abs(), 10.6); 130 assertEquals(x.abs(), 10.6);
131 assertEquals((-x).abs(), 10.6); 131 assertEquals((-x).abs(), 10.6);
132 assertEquals(x.round(), 11); 132 assertEquals(x.round(), 11);
133 assertEquals(x.floor(), 10); 133 assertEquals(x.floor(), 10);
134 assertEquals(x.ceil(), 11); 134 assertEquals(x.ceil(), 11);
135 } 135 }
136 136
137 // TODO(jimhug): Determine correct behavior for mixing ints and floats. 137 // TODO(jimhug): Determine correct behavior for mixing ints and floats.
138 static testIntegerMethods() { 138 static testIntegerMethods() {
139 var y = 9; 139 var y = 9;
140 assertEquals(y.isEven(), false); 140 assertEquals(y.isEven, false);
141 assertEquals(y.isOdd(), true); 141 assertEquals(y.isOdd, true);
142 assertEquals(y.toRadixString(2), '1001'); 142 assertEquals(y.toRadixString(2), '1001');
143 assertEquals(y.toRadixString(3), '100'); 143 assertEquals(y.toRadixString(3), '100');
144 assertEquals(y.toRadixString(16), '9'); 144 assertEquals(y.toRadixString(16), '9');
145 } 145 }
146 146
147 static testStringOperators() { 147 static testStringOperators() {
148 var s = "abcdef"; 148 var s = "abcdef";
149 assertEquals(s, "abcdef"); 149 assertEquals(s, "abcdef");
150 assertEquals(s.charCodeAt(0), 97); 150 assertEquals(s.charCodeAt(0), 97);
151 assertEquals(s[0], 'a'); 151 assertEquals(s[0], 'a');
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 .5.toString(); 266 .5.toString();
267 1.toString(); 267 1.toString();
268 if (false) { 268 if (false) {
269 null.toString(); 269 null.toString();
270 } 270 }
271 '${1}'.toString(); 271 '${1}'.toString();
272 ''.toString(); 272 ''.toString();
273 ''.endsWith(''); 273 ''.endsWith('');
274 } 274 }
275 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698