| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // | 4 // |
| 5 | 5 |
| 6 import 'dart:profiler'; | 6 import 'dart:profiler'; |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 | 8 |
| 9 testGauge1() { | 9 testGauge1() { |
| 10 var gauge = new Gauge('test', 'alpha bravo', 0.0, 100.0); | 10 var gauge = new Gauge('test', 'alpha bravo', 0.0, 100.0); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 testGauge2() { | 26 testGauge2() { |
| 27 var gauge = new Gauge('test', 'alpha bravo', 1.0, 2.0); | 27 var gauge = new Gauge('test', 'alpha bravo', 1.0, 2.0); |
| 28 Expect.equals(1.0, gauge.min); | 28 Expect.equals(1.0, gauge.min); |
| 29 Expect.equals(2.0, gauge.max); | 29 Expect.equals(2.0, gauge.max); |
| 30 Expect.equals(gauge.min, gauge.value); | 30 Expect.equals(gauge.min, gauge.value); |
| 31 Expect.equals('test', gauge.name); | 31 Expect.equals('test', gauge.name); |
| 32 Expect.equals('alpha bravo', gauge.description); | 32 Expect.equals('alpha bravo', gauge.description); |
| 33 | 33 |
| 34 Expect.throws(() { | 34 Expect.throws(() { |
| 35 // min > max. | 35 // min argument > max argument . |
| 36 gauge = new Gauge('test', 'alpha bravo', 2.0, 1.0); | 36 gauge = new Gauge('test', 'alpha bravo', 2.0, 1.0); |
| 37 }); | 37 }); |
| 38 | 38 |
| 39 Expect.throws(() { | 39 Expect.throws(() { |
| 40 // min == max. | 40 // min argument == max argument . |
| 41 gauge = new Gauge('test', 'alpha bravo', 1.0, 1.0); | 41 gauge = new Gauge('test', 'alpha bravo', 1.0, 1.0); |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 Expect.throws(() { | 44 Expect.throws(() { |
| 45 // min is null | 45 // min argument is null |
| 46 gauge = new Gauge('test', 'alpha bravo', null, 1.0); | 46 gauge = new Gauge('test', 'alpha bravo', null, 1.0); |
| 47 }); | 47 }); |
| 48 | 48 |
| 49 Expect.throws(() { | 49 Expect.throws(() { |
| 50 // min is not a double | 50 // min argument is not a double |
| 51 gauge = new Gauge('test', 'alpha bravo', 'string', 1.0); | 51 gauge = new Gauge('test', 'alpha bravo', 'string', 1.0); |
| 52 }); | 52 }); |
| 53 | 53 |
| 54 Expect.throws(() { | 54 Expect.throws(() { |
| 55 // max is null | 55 // max argument is null |
| 56 gauge = new Gauge('test', 'alpha bravo', 1.0, null); | 56 gauge = new Gauge('test', 'alpha bravo', 1.0, null); |
| 57 }); | 57 }); |
| 58 } | 58 } |
| 59 | 59 |
| 60 testCounter() { | 60 testCounter() { |
| 61 var counter = new Counter('test', 'alpha bravo'); | 61 var counter = new Counter('test', 'alpha bravo'); |
| 62 Expect.equals(0.0, counter.value); | 62 Expect.equals(0.0, counter.value); |
| 63 Expect.equals('test', counter.name); | 63 Expect.equals('test', counter.name); |
| 64 Expect.equals('alpha bravo', counter.description); | 64 Expect.equals('alpha bravo', counter.description); |
| 65 counter.value = 1.0; | 65 counter.value = 1.0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 | 103 |
| 104 main() { | 104 main() { |
| 105 testGauge1(); | 105 testGauge1(); |
| 106 testGauge2(); | 106 testGauge2(); |
| 107 testCounter(); | 107 testCounter(); |
| 108 testCustomCounter(); | 108 testCustomCounter(); |
| 109 testMetricNameCollision(); | 109 testMetricNameCollision(); |
| 110 testBadName(); | 110 testBadName(); |
| 111 } | 111 } |
| OLD | NEW |