diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0949abb..3f7ea76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: matrix: # Add macos-latest and/or windows-latest if relevant for this package. os: [ubuntu-latest] - sdk: [3.0, dev] + sdk: [3.4, dev] steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d9ef6..afe767d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.12.17-wip + +* Require Dart 3.4 + ## 0.12.16+1 * Require Dart 3.0 diff --git a/lib/src/custom_matcher.dart b/lib/src/custom_matcher.dart index 4fd53e0..b0f2d6b 100644 --- a/lib/src/custom_matcher.dart +++ b/lib/src/custom_matcher.dart @@ -8,7 +8,9 @@ import 'description.dart'; import 'interfaces.dart'; import 'util.dart'; -/// A useful utility class for implementing other matchers through inheritance. +/// A base class for [Matcher] instances that match based on some feature of the +/// value under test. +/// /// Derived classes should call the base constructor with a feature name and /// description, and an instance matcher, and should implement the /// [featureValueOf] abstract method. diff --git a/lib/src/expect/expect_async.dart b/lib/src/expect/expect_async.dart index 7571383..88cf6f2 100644 --- a/lib/src/expect/expect_async.dart +++ b/lib/src/expect/expect_async.dart @@ -203,7 +203,7 @@ class _ExpectedFunction { void _afterRun() { if (_complete) return; if (_minExpectedCalls > 0 && _actualCalls < _minExpectedCalls) return; - if (_isDone != null && !_isDone!()) return; + if (_isDone != null && !_isDone()) return; // Mark this callback as complete and remove it from the test case's // outstanding callback count; if that hits zero the test is done. diff --git a/lib/src/expect/future_matchers.dart b/lib/src/expect/future_matchers.dart index e1328b6..407b9b8 100644 --- a/lib/src/expect/future_matchers.dart +++ b/lib/src/expect/future_matchers.dart @@ -55,12 +55,12 @@ class _Completes extends AsyncMatcher { String? result; if (_matcher is AsyncMatcher) { - result = await (_matcher as AsyncMatcher).matchAsync(value) as String?; + result = await _matcher.matchAsync(value) as String?; if (result == null) return null; } else { var matchState = {}; - if (_matcher!.matches(value, matchState)) return null; - result = _matcher! + if (_matcher.matches(value, matchState)) return null; + result = _matcher .describeMismatch(value, StringDescription(), matchState, false) .toString(); } diff --git a/lib/src/expect/throws_matcher.dart b/lib/src/expect/throws_matcher.dart index 0ee3144..3a81821 100644 --- a/lib/src/expect/throws_matcher.dart +++ b/lib/src/expect/throws_matcher.dart @@ -121,9 +121,9 @@ class Throws extends AsyncMatcher { if (_matcher == null) return null; var matchState = {}; - if (_matcher!.matches(error, matchState)) return null; + if (_matcher.matches(error, matchState)) return null; - var result = _matcher! + var result = _matcher .describeMismatch(error, StringDescription(), matchState, false) .toString(); diff --git a/pubspec.yaml b/pubspec.yaml index 8b6df88..938a18a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,12 +1,12 @@ name: matcher -version: 0.12.16+1 +version: 0.12.17-wip description: >- Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. repository: https://github.com/dart-lang/matcher environment: - sdk: ^3.0.0 + sdk: ^3.4.0 dependencies: async: ^2.10.0 @@ -19,3 +19,7 @@ dev_dependencies: fake_async: ^1.3.0 lints: ^3.0.0 test: ^1.23.0 + +dependency_overrides: + test: 1.25.0 + test_api: 0.7.3