Index: pkg/analyzer/test/src/util/asserts_test.dart |
diff --git a/pkg/analyzer/test/src/util/asserts_test.dart b/pkg/analyzer/test/src/util/asserts_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8631fdd933df6ae8e6dcf0af1760ce4d84c93a69 |
--- /dev/null |
+++ b/pkg/analyzer/test/src/util/asserts_test.dart |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library test.src.util.asserts; |
+ |
+import 'package:analyzer/src/util/asserts.dart'; |
+import 'package:unittest/unittest.dart'; |
+ |
+import '../../reflective_tests.dart'; |
+ |
+ |
+main() { |
+ groupSep = ' | '; |
+ runReflectiveTests(AnalysisTaskTest); |
+} |
+ |
+ |
+@reflectiveTest |
+class AnalysisTaskTest { |
+ void test_notNull_notNull() { |
+ notNull(this); |
+ } |
+ |
+ void test_notNull_null_hasDescription() { |
+ notNull(this); |
+ expect( |
+ () => notNull(null, 'desc'), |
+ throwsA(new isInstanceOf<ArgumentError>())); |
Brian Wilkerson
2015/02/03 14:54:42
I can't check, but is there a throwsArgumentError?
scheglov
2015/02/03 16:06:12
Done.
|
+ } |
+ |
+ void test_notNull_null_noDescription() { |
+ notNull(this); |
+ expect(() => notNull(null), throwsA(new isInstanceOf<ArgumentError>())); |
+ } |
+} |