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

Unified Diff: tests/corelib/duration_big_num_test.dart

Issue 17591020: Let operator* in Duration accept doubles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: reupload Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: tests/corelib/duration_big_num_test.dart
diff --git a/tests/language/call_this_test.dart b/tests/corelib/duration_big_num_test.dart
similarity index 54%
copy from tests/language/call_this_test.dart
copy to tests/corelib/duration_big_num_test.dart
index 55e7ccd509607ff939e45c328a23ddc0ab023023..46eb32abde21257063471ebc9ea6dd00dbcd3628 100644
--- a/tests/language/call_this_test.dart
+++ b/tests/corelib/duration_big_num_test.dart
@@ -2,17 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Test that dart2js treats [:this():] as a closure send.
-
import "package:expect/expect.dart";
-
-class A {
- call() => 42;
- test1() => this();
- test2() => (this)();
-}
+import 'dart:math';
main() {
- Expect.equals(42, (new A()).test1());
- Expect.equals(42, (new A()).test2());
+ Duration d, d1;
+
+ d1 = new Duration(microseconds: pow(2,53));
floitsch 2013/06/25 15:28:02 space between , and 53: pow(2, 53)
zarah 2013/06/25 15:54:05 Done.
+ d = d1 * 2;
+ Expect.equals(pow(2,54), d.inMicroseconds);
floitsch 2013/06/25 15:28:02 ditto.
zarah 2013/06/25 15:54:05 Done.
+ d = d1 * 1.5;
+ Expect.equals(pow(2,53).toDouble() * 1.5, d.inMicroseconds);
floitsch 2013/06/25 15:28:02 ditto.
zarah 2013/06/25 15:54:05 Done.
}
floitsch 2013/06/25 15:28:02 Add line testing that inMicroseconds still is an i
zarah 2013/06/25 15:54:05 Done.
+

Powered by Google App Engine
This is Rietveld 408576698