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

Side by Side Diff: tests/corelib/num_clamp_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 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
« no previous file with comments | « tests/corelib/null_test.dart ('k') | tests/corelib/queue_first_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) 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 // Test num.clamp. 4 // Test num.clamp.
5 5
6 import "package:expect/expect.dart";
7
8 testIntClamp() { 6 testIntClamp() {
9 Expect.equals(2, 2.clamp(1, 3)); 7 Expect.equals(2, 2.clamp(1, 3));
10 Expect.equals(1, 0.clamp(1, 3)); 8 Expect.equals(1, 0.clamp(1, 3));
11 Expect.equals(3, 4.clamp(1, 3)); 9 Expect.equals(3, 4.clamp(1, 3));
12 Expect.equals(-2, (-2).clamp(-3, -1)); 10 Expect.equals(-2, (-2).clamp(-3, -1));
13 Expect.equals(-1, 0.clamp(-3, -1)); 11 Expect.equals(-1, 0.clamp(-3, -1));
14 Expect.equals(-3, (-4).clamp(-3, -1)); 12 Expect.equals(-3, (-4).clamp(-3, -1));
15 Expect.equals(0, 1.clamp(0, 0)); 13 Expect.equals(0, 1.clamp(0, 0));
16 Expect.equals(0, (-1).clamp(0, 0)); 14 Expect.equals(0, (-1).clamp(0, 0));
17 Expect.equals(0, 0.clamp(0, 0)); 15 Expect.equals(0, 0.clamp(0, 0));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Expect.throws(() => 0.0.clamp(double.NAN, double.INFINITY), 69 Expect.throws(() => 0.0.clamp(double.NAN, double.INFINITY),
72 (e) => e is ArgumentError); 70 (e) => e is ArgumentError);
73 } 71 }
74 72
75 main() { 73 main() {
76 testIntClamp(); 74 testIntClamp();
77 testDoubleClamp(); 75 testDoubleClamp();
78 testDoubleClampInt(); 76 testDoubleClampInt();
79 testDoubleClampExtremes(); 77 testDoubleClampExtremes();
80 } 78 }
OLDNEW
« no previous file with comments | « tests/corelib/null_test.dart ('k') | tests/corelib/queue_first_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698