Line data Source code
1 : // Copyright (c) 2012, 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 : import 'core_matchers.dart';
6 : import 'interfaces.dart';
7 :
8 : /// A matcher for ArgumentErrors.
9 : const Matcher isArgumentError = const _ArgumentError();
10 :
11 : class _ArgumentError extends TypeMatcher {
12 0 : const _ArgumentError() : super("ArgumentError");
13 0 : bool matches(item, Map matchState) => item is ArgumentError;
14 : }
15 :
16 : /// A matcher for ConcurrentModificationError.
17 : const Matcher isConcurrentModificationError =
18 : const _ConcurrentModificationError();
19 :
20 : class _ConcurrentModificationError extends TypeMatcher {
21 0 : const _ConcurrentModificationError() : super("ConcurrentModificationError");
22 0 : bool matches(item, Map matchState) => item is ConcurrentModificationError;
23 : }
24 :
25 : /// A matcher for CyclicInitializationError.
26 : const Matcher isCyclicInitializationError = const _CyclicInitializationError();
27 :
28 : class _CyclicInitializationError extends TypeMatcher {
29 0 : const _CyclicInitializationError() : super("CyclicInitializationError");
30 0 : bool matches(item, Map matchState) => item is CyclicInitializationError;
31 : }
32 :
33 : /// A matcher for Exceptions.
34 : const Matcher isException = const _Exception();
35 :
36 : class _Exception extends TypeMatcher {
37 0 : const _Exception() : super("Exception");
38 0 : bool matches(item, Map matchState) => item is Exception;
39 : }
40 :
41 : /// A matcher for FormatExceptions.
42 : const Matcher isFormatException = const _FormatException();
43 :
44 : class _FormatException extends TypeMatcher {
45 0 : const _FormatException() : super("FormatException");
46 0 : bool matches(item, Map matchState) => item is FormatException;
47 : }
48 :
49 : /// A matcher for NoSuchMethodErrors.
50 : const Matcher isNoSuchMethodError = const _NoSuchMethodError();
51 :
52 : class _NoSuchMethodError extends TypeMatcher {
53 0 : const _NoSuchMethodError() : super("NoSuchMethodError");
54 0 : bool matches(item, Map matchState) => item is NoSuchMethodError;
55 : }
56 :
57 : /// A matcher for NullThrownError.
58 : const Matcher isNullThrownError = const _NullThrownError();
59 :
60 : class _NullThrownError extends TypeMatcher {
61 0 : const _NullThrownError() : super("NullThrownError");
62 0 : bool matches(item, Map matchState) => item is NullThrownError;
63 : }
64 :
65 : /// A matcher for RangeErrors.
66 : const Matcher isRangeError = const _RangeError();
67 :
68 : class _RangeError extends TypeMatcher {
69 0 : const _RangeError() : super("RangeError");
70 0 : bool matches(item, Map matchState) => item is RangeError;
71 : }
72 :
73 : /// A matcher for StateErrors.
74 : const Matcher isStateError = const _StateError();
75 :
76 : class _StateError extends TypeMatcher {
77 0 : const _StateError() : super("StateError");
78 0 : bool matches(item, Map matchState) => item is StateError;
79 : }
80 :
81 : /// A matcher for UnimplementedErrors.
82 : const Matcher isUnimplementedError = const _UnimplementedError();
83 :
84 : class _UnimplementedError extends TypeMatcher {
85 0 : const _UnimplementedError() : super("UnimplementedError");
86 0 : bool matches(item, Map matchState) => item is UnimplementedError;
87 : }
88 :
89 : /// A matcher for UnsupportedError.
90 : const Matcher isUnsupportedError = const _UnsupportedError();
91 :
92 : class _UnsupportedError extends TypeMatcher {
93 0 : const _UnsupportedError() : super("UnsupportedError");
94 0 : bool matches(item, Map matchState) => item is UnsupportedError;
95 : }
|