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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
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
6 testIntClamp() { 8 testIntClamp() {
7 Expect.equals(2, 2.clamp(1, 3)); 9 Expect.equals(2, 2.clamp(1, 3));
8 Expect.equals(1, 0.clamp(1, 3)); 10 Expect.equals(1, 0.clamp(1, 3));
9 Expect.equals(3, 4.clamp(1, 3)); 11 Expect.equals(3, 4.clamp(1, 3));
10 Expect.equals(-2, (-2).clamp(-3, -1)); 12 Expect.equals(-2, (-2).clamp(-3, -1));
11 Expect.equals(-1, 0.clamp(-3, -1)); 13 Expect.equals(-1, 0.clamp(-3, -1));
12 Expect.equals(-3, (-4).clamp(-3, -1)); 14 Expect.equals(-3, (-4).clamp(-3, -1));
13 Expect.equals(0, 1.clamp(0, 0)); 15 Expect.equals(0, 1.clamp(0, 0));
14 Expect.equals(0, (-1).clamp(0, 0)); 16 Expect.equals(0, (-1).clamp(0, 0));
15 Expect.equals(0, 0.clamp(0, 0)); 17 Expect.equals(0, 0.clamp(0, 0));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 Expect.throws(() => 0.0.clamp(double.NAN, double.INFINITY), 71 Expect.throws(() => 0.0.clamp(double.NAN, double.INFINITY),
70 (e) => e is ArgumentError); 72 (e) => e is ArgumentError);
71 } 73 }
72 74
73 main() { 75 main() {
74 testIntClamp(); 76 testIntClamp();
75 testDoubleClamp(); 77 testDoubleClamp();
76 testDoubleClampInt(); 78 testDoubleClampInt();
77 testDoubleClampExtremes(); 79 testDoubleClampExtremes();
78 } 80 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698