-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wishlist: port all tests to quicktest #219
Comments
I'd usually recommend to do a slow transition as the codebase is modified, to avoid too much churn and conflicts. But in this case, given that go-wish and quicktest are pretty similar, it probably doesn't make sense to leave the repository using both for months or years. So maybe it is worth the effort to try to automate the refactor. Maybe it could be done in groups of packages, to make the reviews less painful. |
Port the tests in `node` pacakge to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` Port `closeEnough` Wish checker to its equivelant in quicktest. Relates to: - #219
Port the tests in `node` pacakge to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` Port `closeEnough` Wish checker to its equivelant in quicktest. Relates to: - #219
Port the tests in `node` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` Relates to: - #219
Port the tests in `node` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsNil` for `nil` with `ShouldEqual` Relates to: - #219
Port the tests in `adl` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsNil` for `nil` with `ShouldEqual` Relates to: - #219
Port the tests in `node` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for ShouldEqual` over `true` - `qt.IsFalse` for ShouldEqual` over `false` - `qt.IsNil` for ShouldEqual` over `nil` - `qt.ErrorMatches` for ShouldEqual` over `err.Error()` Port `closeEnough` Wish checker to its equivelant in quicktest. Relates to: - #219
Port the tests in `node` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for ShouldEqual` over `true` - `qt.IsFalse` for ShouldEqual` over `false` - `qt.IsNil` for ShouldEqual` over `nil` Port `closeEnough` Wish checker to its equivalent in quicktest. Relates to: - #219
Port the tests in `node` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for ShouldEqual` over `true` - `qt.IsFalse` for ShouldEqual` over `false` - `qt.IsNil` for ShouldEqual` over `nil` Port `closeEnough` Wish checker to its equivalent in quicktest. Relates to: - #219
Port the tests in `adl` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsNil` for `nil` with `ShouldEqual` Relates to: - #219
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `dagjson.Encode`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219
Port the tests in `datamodel` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.CmpEquals` with custom `Exporter` that exports all fields for `ShouldEqual` over `PathSegment` Relates to: - #219
Port the tests in `datamodel` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.CmpEquals` with custom `Exporter` that exports all fields for `ShouldEqual` over `PathSegment` Relates to: - #219
Port the tests in `fluent` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.DeepEquals` for `ShouldEqual` over `[]byte` and `fluent.Error` Relates to: - #219
Port the tests in `datamodel` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.CmpEquals` with custom `Exporter` that exports all fields for `ShouldEqual` over `PathSegment` Relates to: - #219
Port the tests in `fluent` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.DeepEquals` for `ShouldEqual` over `[]byte` and `fluent.Error` Relates to: - #219
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer.Sprint`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes - `NodeContentEquals` for `datamodel.DeepEqual` over nodes Update `NodeContentEquals` for `datamodel.DeepEqual` over nodes in `node` package while at it. Port `node/mixins/TestSplitExact` over to quicktest missed out in earlier PRs. Note, to assert equality `CmpEqual` is used with an `Exporter` that exports all unexpored fields. Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219 Depends on: - #294
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer.Sprint`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes - `NodeContentEquals` for `datamodel.DeepEqual` over nodes Update `NodeContentEquals` for `datamodel.DeepEqual` over nodes in `node` package while at it. Port `node/mixins/TestSplitExact` over to quicktest missed out in earlier PRs. Note, to assert equality `CmpEqual` is used with an `Exporter` that exports all unexpored fields. Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219 Depends on: - #294
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer.Sprint`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes - `NodeContentEquals` for `datamodel.DeepEqual` over nodes Update `NodeContentEquals` for `datamodel.DeepEqual` over nodes in `node` package while at it. Port `node/mixins/TestSplitExact` over to quicktest missed out in earlier PRs. Note, to assert equality `CmpEqual` is used with an `Exporter` that exports all unexpored fields. Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219 Depends on: - #294
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer.Sprint`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes - `NodeContentEquals` for `datamodel.DeepEqual` over nodes Update `NodeContentEquals` for `datamodel.DeepEqual` over nodes in `node` package while at it. Port `node/mixins/TestSplitExact` over to quicktest missed out in earlier PRs. Note, to assert equality `CmpEqual` is used with an `Exporter` that exports all unexpored fields. Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219 Depends on: - #294
Implement `NodeContentEquals` quicktest checker that checks two given nodes have equal content by comparing their printout using `printer.Sprint`. This simplifies the tests that use `datamode.DeepEqual` by performing an equivalent check while producing a human-readable error when nodes are not equal. The naming for this check is inspired by a similar equality check in quicktest, named `ContentEquals`. Port the tests in `codec` package to quicktest; use: - `qt.Assert` for `wish.Require` - `qt.Check` for `wish.Wish` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.IsNil` for `ShouldEqual` over `nil` - `NodeContentEquals` for `ShouldEqual` over nodes - `NodeContentEquals` for `datamodel.DeepEqual` over nodes Update `NodeContentEquals` for `datamodel.DeepEqual` over nodes in `node` package while at it. Port `node/mixins/TestSplitExact` over to quicktest missed out in earlier PRs. Note, to assert equality `CmpEqual` is used with an `Exporter` that exports all unexpored fields. Address TODO in node tests by using `NodeContentEquals` to check node equality. Relates to: - #219 Depends on: - #294
Port the tests in `traversal` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.Assert` for `wish.Require` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.DeepEquals` for `ShouldEqual` over slices - `CmpEquals` for `ShouldEqual` over types with unexported fields excluding `datamodel.Node` with custom exporter to allow checking of all unexported fields - Defined checker once and reused across packages. Did not add this to `node/tests` to avoid cycle package dependency. - `nodetests.NodeContentEquals` over `datamodel.DeepEqual` and `ShouldEqual` over `datamodel.Node` Fixes #219
Port the tests in `traversal` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.Assert` for `wish.Require` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.HasLen` for `ShouldEqual` over slice length - `qt.DeepEquals` for `ShouldEqual` over slices - `CmpEquals` for `ShouldEqual` over types with unexported fields excluding `datamodel.Node` with custom exporter to allow checking of all unexported fields - Defined checker once and reused across packages. Did not add this to `node/tests` to avoid cycle package dependency. - `nodetests.NodeContentEquals` over `datamodel.DeepEqual` and `ShouldEqual` over `datamodel.Node` Fixes #219
Port the tests in `traversal` package to quicktest; use: - `qt.Check` for `wish.Wish` - `qt.Assert` for `wish.Require` - `qt.IsNil` for `ShouldEqual` over `nil` - `qt.IsTrue` for `ShouldEqual` over `true` - `qt.IsFalse` for `ShouldEqual` over `false` - `qt.HasLen` for `ShouldEqual` over slice length - `qt.DeepEquals` for `ShouldEqual` over slices - `CmpEquals` for `ShouldEqual` over types with unexported fields excluding `datamodel.Node` with custom exporter to allow checking of all unexported fields - Defined checker once and reused across packages. Did not add this to `node/tests` to avoid cycle package dependency. - `nodetests.NodeContentEquals` over `datamodel.DeepEqual` and `ShouldEqual` over `datamodel.Node` Fixes #219
https://pkg.go.dev/github.com/frankban/quicktest is now clearly superior to https://pkg.go.dev/github.com/warpfork/go-wish .
We've started using
quicktest
in some parts of this repo already and it's working great.It would be nice to port all the tests to using
quicktest
and see one more dependency drop from thego.mod
file.This should be relatively easy. The style used by
quicktest
andwish
are syntactically and semantically extremely similar.The text was updated successfully, but these errors were encountered: