OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.test.src.util.asserts_test; | 5 library analyzer.test.src.util.asserts_test; |
6 | 6 |
7 import 'package:analyzer/src/util/asserts.dart'; | 7 import 'package:analyzer/src/util/asserts.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
10 | 10 |
11 import '../../utils.dart'; | |
12 | |
13 main() { | 11 main() { |
14 initializeTestEnvironment(); | |
15 defineReflectiveSuite(() { | 12 defineReflectiveSuite(() { |
16 defineReflectiveTests(AnalysisTaskTest); | 13 defineReflectiveTests(AnalysisTaskTest); |
17 }); | 14 }); |
18 } | 15 } |
19 | 16 |
20 @reflectiveTest | 17 @reflectiveTest |
21 class AnalysisTaskTest { | 18 class AnalysisTaskTest { |
22 void test_notNull_notNull() { | 19 void test_notNull_notNull() { |
23 notNull(this); | 20 notNull(this); |
24 } | 21 } |
25 | 22 |
26 void test_notNull_null_hasDescription() { | 23 void test_notNull_null_hasDescription() { |
27 expect(() => notNull(null, 'desc'), throwsArgumentError); | 24 expect(() => notNull(null, 'desc'), throwsArgumentError); |
28 } | 25 } |
29 | 26 |
30 void test_notNull_null_noDescription() { | 27 void test_notNull_null_noDescription() { |
31 expect(() => notNull(null), throwsArgumentError); | 28 expect(() => notNull(null), throwsArgumentError); |
32 } | 29 } |
33 } | 30 } |
OLD | NEW |