| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 Expect.throws(() { | 49 Expect.throws(() { |
| 50 // min is not a double | 50 // min 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 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 | |
| 59 Expect.throws(() { | |
| 60 // max is not a double | |
| 61 gauge = new Gauge('test', 'alpha bravo', 1.0, 4); | |
| 62 }); | |
| 63 } | 58 } |
| 64 | 59 |
| 65 testCounter() { | 60 testCounter() { |
| 66 var counter = new Counter('test', 'alpha bravo'); | 61 var counter = new Counter('test', 'alpha bravo'); |
| 67 Expect.equals(0.0, counter.value); | 62 Expect.equals(0.0, counter.value); |
| 68 Expect.equals('test', counter.name); | 63 Expect.equals('test', counter.name); |
| 69 Expect.equals('alpha bravo', counter.description); | 64 Expect.equals('alpha bravo', counter.description); |
| 70 counter.value = 1.0; | 65 counter.value = 1.0; |
| 71 Expect.equals(1.0, counter.value); | 66 Expect.equals(1.0, counter.value); |
| 72 } | 67 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 102 } |
| 108 | 103 |
| 109 main() { | 104 main() { |
| 110 testGauge1(); | 105 testGauge1(); |
| 111 testGauge2(); | 106 testGauge2(); |
| 112 testCounter(); | 107 testCounter(); |
| 113 testCustomCounter(); | 108 testCustomCounter(); |
| 114 testMetricNameCollision(); | 109 testMetricNameCollision(); |
| 115 testBadName(); | 110 testBadName(); |
| 116 } | 111 } |
| OLD | NEW |