You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 8, 2020. It is now read-only.
The spec [1] suggests "not ok 13 # TODO ...", but if you attempt this
with:
t.Fail("# TODO foo")
you get an extra hyphen ("not ok 13 - # TODO foo") which is parsed as
a failed test (and not a TODO test).
I'd initially written up an alternative to Ok:
T.TODO(test bool, description string)
but Michael pointed out that future work may add additional test
methods (e.g. EqOk) and wanted to support those as well with something
like [2]:
t.TODO = true
t.Ok(Foo(), "foo")
t.EqOk(Bar(), Baz(), "bar == baz")
t.TODO = false // could be done via defer too
or [2]:
t.TODO( func () {
t.Ok(Foo(), "foo")
t.EqOk(Bar(), Baz(), "bar == baz")
})
The child-state approach taken in this commit is closer to the latter,
but allows for method chaining in the single-test case:
t.TODO().Ok(Foo(), "foo")
which I find easier to read.
The root state is the only one which holds nextTestNumber. It might
make more sense if it was *also* the only the state that held Writer
(so internally t.root().printf(...) instead of t.printf(...)).
However, Writer is public, and we can't keep folks from fiddling with
it. Respecting local overrides makes as much sense as anything,
although I doubt folks will want to override Writer in their TODO
child state.
[1]: http://testanything.org/tap-version-13-specification.html#todo-tests
[2]: #6 (comment)
0 commit comments