Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 import 'test_helper.dart'; | |
|
Kevin Millikin (Google)
2017/02/08 15:37:52
License header.
jensj
2017/02/13 14:04:16
Done.
| |
| 2 import 'service_test_common.dart'; | |
| 3 | |
| 4 const int LINE_A = 8; | |
| 5 const String file = "next_through_is_and_as_test.dart"; | |
| 6 | |
| 7 code() { | |
| 8 var i = 42.42; | |
| 9 var hex = 0x42; | |
| 10 if (i is int) { | |
| 11 print("i is int"); | |
| 12 int x = i as int; | |
| 13 if (x.isEven) { | |
| 14 print("it's even even!"); | |
| 15 } else { | |
| 16 print("but it's not even even!"); | |
| 17 } | |
| 18 } | |
| 19 if (i is! int) { | |
| 20 print("i is not int"); | |
| 21 } | |
| 22 if (hex is int) { | |
| 23 print("hex is int"); | |
| 24 int x = hex as int; | |
| 25 if (x.isEven) { | |
| 26 print("it's even even!"); | |
| 27 } else { | |
| 28 print("but it's not even even!"); | |
| 29 } | |
| 30 } | |
| 31 if (hex is! int) { | |
| 32 print("hex is not int"); | |
| 33 } | |
| 34 } | |
| 35 | |
| 36 List<String> stops = []; | |
| 37 List<String> expected = [ | |
| 38 "$file:${LINE_A+0}:9", | |
| 39 "$file:${LINE_A+1}:11", | |
| 40 "$file:${LINE_A+2}:9", | |
| 41 "$file:${LINE_A+11}:9", | |
| 42 "$file:${LINE_A+12}:5", | |
| 43 "$file:${LINE_A+14}:11", | |
| 44 "$file:${LINE_A+15}:5", | |
| 45 "$file:${LINE_A+16}:17", | |
| 46 "$file:${LINE_A+17}:11", | |
| 47 "$file:${LINE_A+18}:7", | |
| 48 "$file:${LINE_A+23}:11", | |
| 49 "$file:${LINE_A+26}:1" | |
| 50 ]; | |
| 51 | |
| 52 var tests = [ | |
| 53 hasPausedAtStart, | |
| 54 setBreakpointAtLine(LINE_A), | |
| 55 runStepThroughProgramRecordingStops(stops), | |
| 56 checkRecordedStops(stops, expected) | |
| 57 ]; | |
| 58 | |
| 59 main(args) { | |
| 60 runIsolateTestsSynchronous(args, tests, | |
| 61 testeeConcurrent: code, pause_on_start: true, pause_on_exit: true); | |
| 62 } | |
| OLD | NEW |