Chromium Code Reviews| Index: tests/lib/math/math_package_bigint_test.dart |
| diff --git a/tests/lib/math/math_package_bigint_test.dart b/tests/lib/math/math_package_bigint_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e302c7152bbb4f565067e51ad4c67b9f1e92e22b |
| --- /dev/null |
| +++ b/tests/lib/math/math_package_bigint_test.dart |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// 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. |
| + |
| +library math_test; |
| +import "package:expect/expect.dart"; |
| +import 'dart:math'; |
| +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.
|
| + |
| +// See math_package_test.dart first. This file contains only the tests that |
| +// need Bigint or would fail in dart2js compatibility mode. |
| + |
| +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.
|
| + static void testGcdWithBigints() { |
| + Expect.equals(pow(2, 63)*3, gcd(pow(2, 64)*3*5, pow(2,63)*3*7)); |
| + // 595056260442243647 is the first prime after 2**64 / 31. |
| + Expect.equals(595056260442243647, |
| + gcd(31*595056260442243647, 37*595056260442243647)); |
| + } |
| + |
| + static testMain() { |
| + testGcdWithBigints(); |
| + } |
| +} |
| + |
| +main() { |
| + MathPackageBigintTest.testMain(); |
| +} |