dart-lang / matcher

A declarative API for specifying expectations.
https://pub.dev/packages/matcher
BSD 3-Clause "New" or "Revised" License
71 stars 37 forks source link

reverted min dart sdk to 2.12 #204

Closed bsutton closed 1 year ago

bsutton commented 1 year ago

This PR reverts matcher to a min dart-sdk of 2.12 as per issue #203.

There is however a problem with the dependencies which doesn't make sense to me.

The test related packages all use a version of 'any'. I assume this is to make matcher compatible with all versions of the test related packages (even though my understanding is that you should never publish with any?).

The problem is with the test_api override.

I don't understand what the override is doing as test_api already is declared as any. However it clearly is doing something as without it version solving fails.

The problem is that when we have the test_api override `pub' selects the lastest version of test_api (0.4.17) which has a minimum sdk constraint of 2.17. I don't understand why pub is selecting 0.4.17 given that I'm running dart 2.12. My understanding is that the fact that I'm running 2.12 should have excluded 0.4.17 from being selected and instead a dart 2.12 compatible version of test_api should have been chosen.

If I change the override to a dart 2.12 compatible version of test_api all of the unit tests succeed.

The unit tests also succeed for dart 3.x using the test_api override with any.

devoncarew commented 1 year ago

Thanks for the PR! We'll wait for a resolution to https://github.com/dart-lang/matcher/issues/203 before reviewing it.

natebosch commented 1 year ago

Closing since we're rolling forward with the current SDK dep.