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

Side by Side Diff: pkg/fixnum/test/int_32_test.dart

Issue 20803006: Don't throw exception for non-integer args to fixnum int32,int64 op == (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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 int32test; 5 library int32test;
6 import 'package:fixnum/fixnum.dart'; 6 import 'package:fixnum/fixnum.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 8
9 void main() { 9 void main() {
10 group("arithmetic operators", () { 10 group("arithmetic operators", () {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 expect(int32.MIN_VALUE <= int32.MAX_VALUE, true); 106 expect(int32.MIN_VALUE <= int32.MAX_VALUE, true);
107 expect(int32.MAX_VALUE <= int32.MIN_VALUE, false); 107 expect(int32.MAX_VALUE <= int32.MIN_VALUE, false);
108 expect(() => new int32.fromInt(17) <= null, throws); 108 expect(() => new int32.fromInt(17) <= null, throws);
109 }); 109 });
110 110
111 test("==", () { 111 test("==", () {
112 expect(new int32.fromInt(17) == new int32.fromInt(18), false); 112 expect(new int32.fromInt(17) == new int32.fromInt(18), false);
113 expect(new int32.fromInt(17) == new int32.fromInt(17), true); 113 expect(new int32.fromInt(17) == new int32.fromInt(17), true);
114 expect(new int32.fromInt(17) == new int32.fromInt(16), false); 114 expect(new int32.fromInt(17) == new int32.fromInt(16), false);
115 expect(int32.MIN_VALUE == int32.MAX_VALUE, false); 115 expect(int32.MIN_VALUE == int32.MAX_VALUE, false);
116 expect(new int32.fromInt(17) == new Object(), false);
116 expect(new int32.fromInt(17) == null, false); 117 expect(new int32.fromInt(17) == null, false);
117 }); 118 });
118 119
119 test(">=", () { 120 test(">=", () {
120 expect(new int32.fromInt(17) >= new int32.fromInt(18), false); 121 expect(new int32.fromInt(17) >= new int32.fromInt(18), false);
121 expect(new int32.fromInt(17) >= new int32.fromInt(17), true); 122 expect(new int32.fromInt(17) >= new int32.fromInt(17), true);
122 expect(new int32.fromInt(17) >= new int32.fromInt(16), true); 123 expect(new int32.fromInt(17) >= new int32.fromInt(16), true);
123 expect(int32.MIN_VALUE >= int32.MAX_VALUE, false); 124 expect(int32.MIN_VALUE >= int32.MAX_VALUE, false);
124 expect(int32.MAX_VALUE >= int32.MIN_VALUE, true); 125 expect(int32.MAX_VALUE >= int32.MIN_VALUE, true);
125 expect(() => new int32.fromInt(17) >= null, throws); 126 expect(() => new int32.fromInt(17) >= null, throws);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 "ffffff"); 228 "ffffff");
228 }); 229 });
229 }); 230 });
230 231
231 group("toRadixString", () { 232 group("toRadixString", () {
232 test("returns base n string representation", () { 233 test("returns base n string representation", () {
233 expect(new int32.fromInt(123456789).toRadixString(5), "223101104124"); 234 expect(new int32.fromInt(123456789).toRadixString(5), "223101104124");
234 }); 235 });
235 }); 236 });
236 } 237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698