From 75388729c7741439cc57d8436cfe3bf1e1b166a7 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Fri, 17 Mar 2023 09:19:55 -0700 Subject: [PATCH 01/16] Make the arguments to `expect` dynamic again (#212) These were changed to `Object?` from implicit dynamic to satisfy stricter linting in the matcher package, however there are edge cases where changing an argument type from `dynamic` to `Object?` is breaking, so use explicit `dynamic` instead. The type change can be breaking in cases where it influences inference behavior for one of the arguments. The `dynamic` will not impose a context type on the argument value, while `Object?` does, which changes how generics get inferred. --- lib/src/expect/expect.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/expect/expect.dart b/lib/src/expect/expect.dart index c0b9950..8dd8cae 100644 --- a/lib/src/expect/expect.dart +++ b/lib/src/expect/expect.dart @@ -48,7 +48,7 @@ typedef ErrorFormatter = String Function(Object? actual, Matcher matcher, /// the test doesn't complete until the matcher has either matched or failed. If /// you want to wait for the matcher to complete before continuing the test, you /// can call [expectLater] instead and `await` the result. -void expect(Object? actual, Object? matcher, +void expect(dynamic actual, dynamic matcher, {String? reason, Object? /* String|bool */ skip, @Deprecated('Will be removed in 0.13.0.') bool verbose = false, @@ -68,12 +68,12 @@ void expect(Object? actual, Object? matcher, /// /// If the matcher fails asynchronously, that failure is piped to the returned /// future where it can be handled by user code. -Future expectLater(Object? actual, Object? matcher, +Future expectLater(dynamic actual, dynamic matcher, {String? reason, Object? /* String|bool */ skip}) => _expect(actual, matcher, reason: reason, skip: skip); /// The implementation of [expect] and [expectLater]. -Future _expect(actual, matcher, +Future _expect(Object? actual, Object? matcher, {String? reason, skip, bool verbose = false, ErrorFormatter? formatter}) { final test = TestHandle.current; formatter ??= (actual, matcher, reason, matchState, verbose) { From dc310d95663da10a90e7898cd4e322695f693d4f Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Fri, 17 Mar 2023 10:33:00 -0700 Subject: [PATCH 02/16] Export more APIs through the expect library (#213) When we split `test_api` into smaller libraries I did not include some deprecated or less used APIs through the "focused" library `expect.dart`, while still exporting them through the combined `test_api.dart` library to avoid a backwards incompatibility. Now that we are moving the APIs to a package we will discontinue, it is not as valuable to try to push migrations between APIs _within_ the package, so re-export them through the `expect.dart` library. This reduces the level of breaking change so that an import update will be all that is needed in every case. --- lib/expect.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/expect.dart b/lib/expect.dart index d790b7c..c842d30 100644 --- a/lib/expect.dart +++ b/lib/expect.dart @@ -6,7 +6,7 @@ export 'matcher.dart'; -export 'src/expect/expect.dart' show expect, expectLater, fail; +export 'src/expect/expect.dart' show ErrorFormatter, expect, expectLater, fail; export 'src/expect/expect_async.dart' show Func0, @@ -48,7 +48,7 @@ export 'src/expect/stream_matchers.dart' emitsThrough, mayEmitMultiple, neverEmits; -export 'src/expect/throws_matcher.dart' show throwsA; +export 'src/expect/throws_matcher.dart' show Throws, throws, throwsA; export 'src/expect/throws_matchers.dart' show throwsArgumentError, From 61f43473951ce425982c2cfb694f3fbe50b1655e Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 21 Mar 2023 12:53:23 -0700 Subject: [PATCH 03/16] Prepare to publish (#214) This release will introduce a cyclic dependency with `package:test_api`. The publish will need to happen with a warning from pub. --- CHANGELOG.md | 2 +- pubspec.yaml | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c3e78..8dc80c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.12.15-dev +## 0.12.15 * Add `package:matcher/expect.dart` library. Copies the implementation of `expect` and the asynchronous matchers from `package:test`. diff --git a/pubspec.yaml b/pubspec.yaml index 87b4cc3..d7f8435 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: matcher -version: 0.12.14 +version: 0.12.15 description: >- Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. @@ -19,17 +19,3 @@ dev_dependencies: fake_async: ^1.3.0 lints: ^2.0.0 test: ^1.23.0 - -dependency_overrides: - test_api: - git: - url: https://github.com/dart-lang/test - path: pkgs/test_api - test_core: - git: - url: https://github.com/dart-lang/test - path: pkgs/test_core - test: - git: - url: https://github.com/dart-lang/test - path: pkgs/test From cb6b68c603d2c57a51bbddfff08fa211bba7dcd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:53:03 -0700 Subject: [PATCH 04/16] Bump actions/checkout from 3.3.0 to 3.5.0 (#216) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.5.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/ac593985615ec2ede58e132d2e21d2b1cbd6127c...8f4b7f84864484a7bf31766abe9204da3cbe65b3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8812a14..9e46801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 with: sdk: ${{ matrix.sdk }} From 7228c26b9c8592e7c410ebff26f8bb136bad9ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 10:45:18 -0700 Subject: [PATCH 05/16] Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#215) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/dart-lang/setup-dart/releases) - [Changelog](https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md) - [Commits](https://github.com/dart-lang/setup-dart/compare/a57a6c04cf7d4840e88432aad6281d1e125f0d46...d6a63dab3335f427404425de0fbfed4686d93c4f) --- updated-dependencies: - dependency-name: dart-lang/setup-dart dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e46801..db4337a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: sdk: [dev] steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} - id: install @@ -50,7 +50,7 @@ jobs: sdk: [2.18.0, dev] steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} - id: install From 5890f2b61704481f6f09ea3a443159c0dc307180 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 1 May 2023 21:24:15 -0700 Subject: [PATCH 06/16] Expand bound for `test_api` dependency (#219) Allow the next breaking release which will remove the exports of libraries from this package and remove the cyclic dependency. --- CHANGELOG.md | 5 +++++ pubspec.yaml | 8 ++++++-- test/expect_async_test.dart | 10 +++++----- test/matcher/throws_test.dart | 16 ++++++++-------- test/matcher/throws_type_test.dart | 4 ++-- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc80c6..6ca1b03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.12.16 + +* Expand bounds on `test_api` dependency to allow the next breaking release + which will remove the cyclic dependency on this package. + ## 0.12.15 * Add `package:matcher/expect.dart` library. Copies the implementation of diff --git a/pubspec.yaml b/pubspec.yaml index d7f8435..8145106 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: matcher -version: 0.12.15 +version: 0.12.16 description: >- Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. @@ -13,9 +13,13 @@ dependencies: meta: ^1.8.0 stack_trace: ^1.10.0 term_glyph: ^1.2.0 - test_api: ^0.5.0 + test_api: ">=0.5.0 <0.7.0" dev_dependencies: fake_async: ^1.3.0 lints: ^2.0.0 test: ^1.23.0 + +dependency_overrides: + test: 1.24.2 + test_api: 0.5.2 diff --git a/test/expect_async_test.dart b/test/expect_async_test.dart index 991ca28..dd564ea 100644 --- a/test/expect_async_test.dart +++ b/test/expect_async_test.dart @@ -336,7 +336,7 @@ void main() { test('works with no arguments', () async { var callbackRun = false; var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expectAsync(() { callbackRun = true; })(); @@ -349,7 +349,7 @@ void main() { test('works with dynamic arguments', () async { var callbackRun = false; var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expectAsync((arg1, arg2) { callbackRun = true; })(1, 2); @@ -362,7 +362,7 @@ void main() { test('works with non-nullable arguments', () async { var callbackRun = false; var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expectAsync((int arg1, int arg2) { callbackRun = true; })(1, 2); @@ -375,7 +375,7 @@ void main() { test('works with 6 arguments', () async { var callbackRun = false; var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expectAsync((arg1, arg2, arg3, arg4, arg5, arg6) { callbackRun = true; })(1, 2, 3, 4, 5, 6); @@ -386,7 +386,7 @@ void main() { }); test("doesn't support a function with 7 arguments", () { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(() => expectAsync((a, b, c, d, e, f, g) {}), throwsArgumentError); }); }); diff --git a/test/matcher/throws_test.dart b/test/matcher/throws_test.dart index c230de1..25b93a9 100644 --- a/test/matcher/throws_test.dart +++ b/test/matcher/throws_test.dart @@ -15,14 +15,14 @@ void main() { group('synchronous', () { group('[throws]', () { test('with a function that throws an error', () { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(() => throw 'oh no', throws); }); test("with a function that doesn't throw", () async { void local() {} var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(local, throws); }); @@ -38,7 +38,7 @@ void main() { test('with a non-function', () async { var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(10, throws); }); @@ -114,13 +114,13 @@ void main() { group('asynchronous', () { group('[throws]', () { test('with a Future that throws an error', () { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(Future.error('oh no'), throws); }); test("with a Future that doesn't throw", () async { var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(Future.value(), throws); }); @@ -135,13 +135,13 @@ void main() { }); test('with a closure that returns a Future that throws an error', () { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(() => Future.error('oh no'), throws); }); test("with a closure that returns a Future that doesn't throw", () async { var monitor = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(Future.value, throws); }); @@ -159,7 +159,7 @@ void main() { late void Function() callback; final monitor = TestCaseMonitor.start(() { final completer = Completer(); - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(completer.future, throws); callback = () => completer.completeError('oh no'); }); diff --git a/test/matcher/throws_type_test.dart b/test/matcher/throws_type_test.dart index 1c3d193..f4c55b0 100644 --- a/test/matcher/throws_type_test.dart +++ b/test/matcher/throws_type_test.dart @@ -47,13 +47,13 @@ void main() { test('passes when a CyclicInitializationError is thrown', () { expect( () => _CyclicInitializationFailure().x, - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package throwsCyclicInitializationError); }); test('fails when a non-CyclicInitializationError is thrown', () async { var liveTest = await TestCaseMonitor.run(() { - // ignore: deprecated_member_use + // ignore: deprecated_member_use_from_same_package expect(() => throw Exception(), throwsCyclicInitializationError); }); From 4dfd9adfdcd3de95e6964fc295075a32635e5b37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 14:03:04 -0700 Subject: [PATCH 07/16] Bump actions/checkout from 3.5.0 to 3.5.2 (#218) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...8e5e7e5ab8b370d6c329ec480221332ada57f0ab) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nate Bosch --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db4337a..6250b97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} From 7e1011772566a8d1817c725a71f091e2791721c8 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 18 May 2023 13:02:12 -0700 Subject: [PATCH 08/16] blast_repo fixes (#224) * blast_repo fixes dependabot * dartfmt --- .github/dependabot.yml | 2 ++ lib/src/type_matcher.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b2f1dec..c84404d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,5 @@ updates: directory: / schedule: interval: monthly + labels: + - autosubmit diff --git a/lib/src/type_matcher.dart b/lib/src/type_matcher.dart index 500ce0c..c78a3b2 100644 --- a/lib/src/type_matcher.dart +++ b/lib/src/type_matcher.dart @@ -62,7 +62,7 @@ class TypeMatcher extends Matcher { const TypeMatcher( [@Deprecated('Provide a type argument to TypeMatcher and omit the name. ' 'This argument will be removed in the next release.') - String? name]) + String? name]) : _name = // ignore: deprecated_member_use_from_same_package name; From ce8f40934c90e12992071172795b3bca29fac295 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jul 2023 04:52:18 +0000 Subject: [PATCH 09/16] Bump actions/checkout from 3.5.2 to 3.5.3 (#225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
Release notes

Sourced from actions/checkout's releases.

v3.5.3

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v3.5.3

Changelog

Sourced from actions/checkout's changelog.

Changelog

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

v3.0.1

v3.0.0

v2.3.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.2&new-version=3.5.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6250b97..67acd53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} From 80910d6698576ba486ace6e5fdf0e27324f138db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 04:40:18 +0000 Subject: [PATCH 10/16] Bump actions/checkout from 3.5.3 to 3.6.0 (#227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
Release notes

Sourced from actions/checkout's releases.

v3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

Changelog

Sourced from actions/checkout's changelog.

Changelog

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

v3.0.1

v3.0.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.3&new-version=3.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67acd53..d030842 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} From 11daad9d3b62539feca5decfa465ccdfb87dde86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 05:03:22 +0000 Subject: [PATCH 11/16] Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (#229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.0 to 1.5.1.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

  • The install location of the Dart SDK is now available in an environment variable, DART_HOME (#43).
  • Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (#35).

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

  • Added a flavor option setup.sh to allow downloading unpublished builds.

v1.0.0

  • Promoted to 1.0 stable.

v0.5

  • Fixed a Windows pub global activate path issue.

... (truncated)

Commits
  • 8a4b97e Support renaming the be channel to main. (#102)
  • 0970dcf Bump @​actions/http-client from 2.1.0 to 2.1.1 (#101)
  • e58aeb6 updates for the latest version of extension types (#100)
  • deafe40 Convert to extension types (#99)
  • cdb51ff Bump semver from 6.3.0 to 6.3.1 (#98)
  • e2fce12 update JS interop - remove JS typedef references (#97)
  • 42c988f set up a cron to build the action's javascript (#96)
  • 007c7cb blast_repo fixes (#92)
  • 08de7e0 Remove annotations no longer needed (#91)
  • bd8bef0 Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#89)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.0&new-version=1.5.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d030842..650a5ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: sdk: [dev] steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} - id: install @@ -50,7 +50,7 @@ jobs: sdk: [2.18.0, dev] steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} - id: install From 356e5f68d3484d44b9ef3b814ed95f9de17c7afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:14:54 -0700 Subject: [PATCH 12/16] Bump actions/checkout from 3.6.0 to 4.1.0 (#228) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/f43a0e5ff2bd294095638e18286ca9a3d1956744...8ade135a41bc03ea155e62e844d188df1ea18608) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 650a5ce..04dbd41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} From 7512f8056486f6b0855ec9307ce0f93902c329e7 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 23 Oct 2023 15:26:17 -0700 Subject: [PATCH 13/16] Specify language in neverCalled docs for nicer formatting in docs (#230) This will also allow dartdoc's `missing-code-block-language` warning in Flutter. --- CHANGELOG.md | 2 ++ lib/src/expect/never_called.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca1b03..179f557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.12.17-wip + ## 0.12.16 * Expand bounds on `test_api` dependency to allow the next breaking release diff --git a/lib/src/expect/never_called.dart b/lib/src/expect/never_called.dart index 46d27f0..20b5299 100644 --- a/lib/src/expect/never_called.dart +++ b/lib/src/expect/never_called.dart @@ -17,7 +17,7 @@ import 'util/pretty_print.dart'; /// This can safely be passed in place of any callback that takes ten or fewer /// positional parameters. For example: /// -/// ``` +/// ```dart /// // Asserts that the stream never emits an event. /// stream.listen(neverCalled); /// ``` diff --git a/pubspec.yaml b/pubspec.yaml index 8145106..3979a07 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: matcher -version: 0.12.16 +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. From b7d24c870ff4fd268416778751bc4e6433693b95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 04:17:05 +0000 Subject: [PATCH 14/16] Bump actions/checkout from 4.1.0 to 4.1.1 (#232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
Release notes

Sourced from actions/checkout's releases.

v4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.0...v4.1.1

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.0&new-version=4.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04dbd41..06b6976 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: sdk: [dev] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} @@ -49,7 +49,7 @@ jobs: os: [ubuntu-latest] sdk: [2.18.0, dev] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} From 3d03fa1a3e8f166b9e2ec8557c5d5e83ae1c85bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:54:45 +0000 Subject: [PATCH 15/16] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#231) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.1 to 1.6.0.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

  • The install location of the Dart SDK is now available in an environment variable, DART_HOME (#43).
  • Fixed an issue where cached downloads could lead to unzip issues on self-hosted runners (#35).

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

  • Added a flavor option setup.sh to allow downloading unpublished builds.

v1.0.0

  • Promoted to 1.0 stable.

v0.5

  • Fixed a Windows pub global activate path issue.

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.1&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06b6976..9997eef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: sdk: [dev] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} - id: install @@ -50,7 +50,7 @@ jobs: sdk: [2.18.0, dev] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} - id: install From fcbd3616c1dbe636d22d2b164aee3f1c32c52a42 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 21 Nov 2023 13:51:47 -0800 Subject: [PATCH 16/16] Add more advice away from predicate (#233) Add a best practice entry and expand the dartdoc for `predicate` to mention that the failure messages are not as detailed as `TypeMatcher`, and that the latter is preferred when the value can fail in more than one way. Add a generic argument to the example usage - most cases should prefer to include a generic. Cleanup an unnecessary private `typedef` with a single usage. --- README.md | 11 +++++++++++ lib/src/core_matchers.dart | 21 +++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9f44237..3044238 100644 --- a/README.md +++ b/README.md @@ -253,3 +253,14 @@ why the test failed. For instance compare the failures between Which: has length of <2> ``` + +### Prefer TypeMatcher to predicate if the match can fail in multiple ways + +The `predicate` utility is a convenient shortcut for testing an arbitrary +(synchronous) property of a value, but it discards context and failures are +opaque. Different failure modes cannot be distinguished in the output which is +determined by a single "description" argument. Using `isA()` and the +`TypeMatcher.having` API to extract and test derived properties in a structured +way brings the context of that structure through to failure messages, so +failures for different reasons will have distinguishable and actionable failure +messages. diff --git a/lib/src/core_matchers.dart b/lib/src/core_matchers.dart index 45d1f27..70e3449 100644 --- a/lib/src/core_matchers.dart +++ b/lib/src/core_matchers.dart @@ -290,20 +290,29 @@ class _In extends FeatureMatcher { description.add('is in ').addDescriptionOf(_source); } -/// Returns a matcher that uses an arbitrary function that returns -/// true or false for the actual value. +/// Returns a matcher that uses an arbitrary function that returns whether the +/// value is considered a match. /// /// For example: /// -/// expect(v, predicate((x) => ((x % 2) == 0), "is even")) +/// expect(actual, predicate((v) => (v % 2) == 0, 'is even')); +/// +/// Use this method when a value is checked for one conceptual property +/// described by [description]. +/// +/// If the value can be rejected for more than one reason prefer using [isA] and +/// the [TypeMatcher.having] API to build up a matcher with output that can +/// distinquish between them. +/// +/// Using an explicit generict argument allows a passed function literal to have +/// an inferred argument type of [T], and values of the wrong type will be +/// rejected with an informative message. Matcher predicate(bool Function(T) f, [String description = 'satisfies function']) => _Predicate(f, description); -typedef _PredicateFunction = bool Function(T value); - class _Predicate extends FeatureMatcher { - final _PredicateFunction _matcher; + final bool Function(T) _matcher; final String _description; _Predicate(this._matcher, this._description);