OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library unittest.skipped_soloed_nested_test; |
| 6 |
| 7 import 'package:unittest/unittest.dart'; |
| 8 |
| 9 import 'package:metatest/metatest.dart'; |
| 10 |
| 11 void main() => initTests(_test); |
| 12 |
| 13 void _test(message) { |
| 14 initMetatest(message); |
| 15 |
| 16 expectTestResults('skipped/soloed nested groups with setup/teardown', () { |
| 17 StringBuffer s = null; |
| 18 setUp(() { |
| 19 if (s == null) s = new StringBuffer(); |
| 20 }); |
| 21 test('top level', () { |
| 22 s.write('A'); |
| 23 }); |
| 24 skip_test('skipped top level', () { |
| 25 s.write('B'); |
| 26 }); |
| 27 skip_group('skipped top level group', () { |
| 28 setUp(() { |
| 29 s.write('C'); |
| 30 }); |
| 31 solo_test('skipped solo nested test', () { |
| 32 s.write('D'); |
| 33 }); |
| 34 }); |
| 35 group('non-solo group', () { |
| 36 setUp(() { |
| 37 s.write('E'); |
| 38 }); |
| 39 test('in non-solo group', () { |
| 40 s.write('F'); |
| 41 }); |
| 42 solo_test('solo_test in non-solo group', () { |
| 43 s.write('G'); |
| 44 }); |
| 45 }); |
| 46 solo_group('solo group', () { |
| 47 setUp(() { |
| 48 s.write('H'); |
| 49 }); |
| 50 test('solo group non-solo test', () { |
| 51 s.write('I'); |
| 52 }); |
| 53 solo_test('solo group solo test', () { |
| 54 s.write('J'); |
| 55 }); |
| 56 group('nested non-solo group in solo group', () { |
| 57 test('nested non-solo group non-solo test', () { |
| 58 s.write('K'); |
| 59 }); |
| 60 solo_test('nested non-solo group solo test', () { |
| 61 s.write('L'); |
| 62 }); |
| 63 }); |
| 64 }); |
| 65 solo_test('final', () { |
| 66 expect(s.toString(), "EGHIHJHKHL"); |
| 67 }); |
| 68 }, [ |
| 69 { |
| 70 'description': 'non-solo group solo_test in non-solo group', |
| 71 'result': 'pass', |
| 72 }, |
| 73 {'description': 'solo group solo group non-solo test', 'result': 'pass',}, |
| 74 {'description': 'solo group solo group solo test', 'result': 'pass',}, |
| 75 { |
| 76 'description': 'solo group nested non-solo group in solo group ' |
| 77 'nested non-solo group non-solo test', |
| 78 'result': 'pass', |
| 79 }, |
| 80 { |
| 81 'description': 'solo group nested non-solo group in solo group ' |
| 82 'nested non-solo group solo test', |
| 83 'result': 'pass', |
| 84 }, |
| 85 {'description': 'final', 'result': 'pass',} |
| 86 ]); |
| 87 } |
OLD | NEW |