Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library math_test; | |
| 6 import "package:expect/expect.dart"; | |
| 7 import 'dart:math'; | |
| 8 import 'package:math/math.dart'; | |
|
Lasse Reichstein Nielsen
2014/08/20 12:17:02
Test of package functionality should go in the pac
srawlins
2014/08/25 05:43:54
Done.
| |
| 9 | |
| 10 // See math_package_test.dart first. This file contains only the tests that | |
| 11 // need Bigint or would fail in dart2js compatibility mode. | |
| 12 | |
| 13 class MathPackageBigintTest { | |
|
Lasse Reichstein Nielsen
2014/08/20 12:17:02
No need for a class here, or a testMain method, ju
srawlins
2014/08/25 05:43:54
Done.
| |
| 14 static void testGcdWithBigints() { | |
| 15 Expect.equals(pow(2, 63)*3, gcd(pow(2, 64)*3*5, pow(2,63)*3*7)); | |
| 16 // 595056260442243647 is the first prime after 2**64 / 31. | |
| 17 Expect.equals(595056260442243647, | |
| 18 gcd(31*595056260442243647, 37*595056260442243647)); | |
| 19 } | |
| 20 | |
| 21 static testMain() { | |
| 22 testGcdWithBigints(); | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 main() { | |
| 27 MathPackageBigintTest.testMain(); | |
| 28 } | |
| OLD | NEW |