| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Test num.clamp. | 4 // Test num.clamp. |
| 5 // VMOptions=--no-use-field-guards | 5 // VMOptions=--no-use-field-guards |
| 6 // VMOptions= | 6 // VMOptions= |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 // Pedestrian implementation of sign, following its specification directly. | 10 // Pedestrian implementation of sign, following its specification directly. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 Expect.equals(number.isNegative, actualSign.isNegative, "$number:negative"); | 100 Expect.equals(number.isNegative, actualSign.isNegative, "$number:negative"); |
| 101 var renumber = actualSign * number.abs(); | 101 var renumber = actualSign * number.abs(); |
| 102 Expect.equals(number, renumber, "$number (sign*abs)"); | 102 Expect.equals(number, renumber, "$number (sign*abs)"); |
| 103 if (number is int) { | 103 if (number is int) { |
| 104 Expect.isTrue(renumber is int, "$number (sign*abs) is int"); | 104 Expect.isTrue(renumber is int, "$number (sign*abs) is int"); |
| 105 } else { | 105 } else { |
| 106 Expect.isTrue(renumber is double, "$number (sign*abs) is double"); | 106 Expect.isTrue(renumber is double, "$number (sign*abs) is double"); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 } | 109 } |
| OLD | NEW |