-
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
Port codec
package tests to quicktest
#291
Conversation
3c062db
to
e8ff2a5
Compare
@@ -1,14 +1,16 @@ | |||
package dagjson | |||
package dagjson_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
e8ff2a5
to
bc95373
Compare
Tests fail because #294 is not merged yet. Once that's merged, this branch needs a rebase and we are good to go 🚀 |
Said PR merged, if you want to rebase. |
bc95373
to
02e33c9
Compare
OK now we are hitting this: |
02e33c9
to
6397c8b
Compare
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
6397c8b
to
568a6d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!
Implement
NodeContentEquals
quicktest checker that checks two givennodes have equal content by comparing their printout using
printer.Sprint
. This simplifies the tests that usedatamode.DeepEqual
by performing an equivalent check while producing ahuman-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
forwish.Require
qt.Check
forwish.Wish
qt.IsTrue
forShouldEqual
overtrue
qt.IsFalse
forShouldEqual
overfalse
qt.IsNil
forShouldEqual
overnil
NodeContentEquals
forShouldEqual
over nodesNodeContentEquals
fordatamodel.DeepEqual
over nodesUpdate
NodeContentEquals
fordatamodel.DeepEqual
over nodes innode
package while at it.Port
node/mixins/TestSplitExact
over to quicktest missed out inearlier PRs. Note, to assert equality
CmpEqual
is used with anExporter
that exports all unexpored fields.Address TODO in node tests by using
NodeContentEquals
to check nodeequality.
Relates to:
Depends on:
Link
and[]byte
inprinter
#294