OLD | NEW |
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 // Dart test program to test arithmetic operations. | 4 // Dart test program to test arithmetic operations. |
5 | 5 |
6 library arithmetic_test; | 6 #library('arithmetic_test'); |
7 import 'dart:math'; | 7 #import('dart:math'); |
8 | 8 |
9 class ArithmeticTest { | 9 class ArithmeticTest { |
10 | 10 |
11 static bool exceptionCaughtParseInt(String s) { | 11 static bool exceptionCaughtParseInt(String s) { |
12 try { | 12 try { |
13 parseInt(s); | 13 parseInt(s); |
14 return false; | 14 return false; |
15 } on FormatException catch (e) { | 15 } on FormatException catch (e) { |
16 return true; | 16 return true; |
17 } | 17 } |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 static testMain() { | 415 static testMain() { |
416 for (int i = 0; i < 1500; i++) { | 416 for (int i = 0; i < 1500; i++) { |
417 runOne(); | 417 runOne(); |
418 } | 418 } |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 main() { | 422 main() { |
423 ArithmeticTest.testMain(); | 423 ArithmeticTest.testMain(); |
424 } | 424 } |
OLD | NEW |