duh we want the verbose output

g-counter
Jordan Orelli 4 years ago
parent 31687f1014
commit e7c4ebf7fd

@ -1,8 +1,24 @@
. === RUN TestOnce
Given some integer with a starting value
When the integer is incremented
The value should be greater by one ✔
1 total assertion 1 total assertion
.. --- PASS: TestOnce (0.00s)
=== RUN TestTwice
Given some integer with a starting value
When the integer is incremented
The value should be greater by one ✔
When the integer is incremented again
The value should be greater by one ✔
3 total assertions 3 total assertions
--- PASS: TestTwice (0.00s)
PASS PASS
ok github.com/jordanorelli/tea/examples/incr 0.002s ok github.com/jordanorelli/tea/examples/incr 0.003s

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
go test 2>&1 | tee tea.output go test 2>&1 -v | tee tea.output
go test -tags std 2>&1 | tee std.output go test -tags std -v 2>&1 | tee std.output
go test -tags convey 2>&1 | tee convey.output go test -tags convey -v 2>&1 | tee convey.output

@ -1,6 +1,14 @@
=== RUN TestOnce
=== RUN TestOnce/increment
--- PASS: TestOnce (0.00s)
--- PASS: TestOnce/increment (0.00s)
=== RUN TestTwice
=== RUN TestTwice/increment
=== RUN TestTwice/increment#01
TestTwice/increment#01: std_test.go:34: expected x to be 2, is 3 instead
--- FAIL: TestTwice (0.00s) --- FAIL: TestTwice (0.00s)
--- PASS: TestTwice/increment (0.00s)
--- FAIL: TestTwice/increment#01 (0.00s) --- FAIL: TestTwice/increment#01 (0.00s)
std_test.go:34: expected x to be 2, is 3 instead
FAIL FAIL
exit status 1 exit status 1
FAIL github.com/jordanorelli/tea/examples/incr 0.002s FAIL github.com/jordanorelli/tea/examples/incr 0.001s

@ -1,17 +1,49 @@
--- FAIL: TestOnce (0.00s) === RUN TestOnce
--- FAIL: TestOnce/testInt (0.00s) === RUN TestOnce/testInt
tea_test.go:15: saving to future tests X = 1 TestOnce/testInt: tea_test.go:20: saving to future tests X = 1
--- FAIL: TestOnce/testInt/testIncr (0.00s) === RUN TestOnce/testInt/testIncr
tea_test.go:15: saving to future tests X = 1 TestOnce/testInt/testIncr: tea_test.go:20: saving to future tests X = 1
tea_test.go:24: loaded from parent tests X = 1 TestOnce/testInt/testIncr: tea_test.go:33: loaded from parent tests X = 1
tea_test.go:29: saving to future tests X = 2 TestOnce/testInt/testIncr: tea_test.go:38: saving to future tests X = 2
--- FAIL: TestOnce/testInt/testIncr/testIncr (0.00s) --- PASS: TestOnce (0.00s)
tea_test.go:15: saving to future tests X = 1 --- PASS: TestOnce/testInt (0.00s)
tea_test.go:24: loaded from parent tests X = 1 --- PASS: TestOnce/testInt/testIncr (0.00s)
tea_test.go:29: saving to future tests X = 2 === RUN TestTwice
tea_test.go:24: loaded from parent tests X = 1 === RUN TestTwice/testInt
tea_test.go:27: expected X to be 3, is 2 instead TestTwice/testInt: tea_test.go:20: saving to future tests X = 1
tea_test.go:29: saving to future tests X = 2 === RUN TestTwice/testInt/testIncr
FAIL TestTwice/testInt/testIncr: tea_test.go:20: saving to future tests X = 1
exit status 1 TestTwice/testInt/testIncr: tea_test.go:33: loaded from parent tests X = 1
FAIL github.com/jordanorelli/tea/examples/incr 0.002s TestTwice/testInt/testIncr: tea_test.go:38: saving to future tests X = 2
=== RUN TestTwice/testInt/testIncr#01
TestTwice/testInt/testIncr#01: tea_test.go:20: saving to future tests X = 1
TestTwice/testInt/testIncr#01: tea_test.go:33: loaded from parent tests X = 1
TestTwice/testInt/testIncr#01: tea_test.go:38: saving to future tests X = 2
--- PASS: TestTwice (0.00s)
--- PASS: TestTwice/testInt (0.00s)
--- PASS: TestTwice/testInt/testIncr (0.00s)
--- PASS: TestTwice/testInt/testIncr#01 (0.00s)
=== RUN TestTwiceSeries
=== RUN TestTwiceSeries/testInt
TestTwiceSeries/testInt: tea_test.go:20: saving to future tests X = 1
=== RUN TestTwiceSeries/testInt/testIncr
TestTwiceSeries/testInt/testIncr: tea_test.go:20: saving to future tests X = 1
TestTwiceSeries/testInt/testIncr: tea_test.go:33: loaded from parent tests X = 1
TestTwiceSeries/testInt/testIncr: tea_test.go:38: saving to future tests X = 2
=== RUN TestTwiceSeries/testInt/testIncr/testIncr
TestTwiceSeries/testInt/testIncr/testIncr: tea_test.go:20: saving to future tests X = 1
TestTwiceSeries/testInt/testIncr/testIncr: tea_test.go:33: loaded from parent tests X = 1
TestTwiceSeries/testInt/testIncr/testIncr: tea_test.go:38: saving to future tests X = 2
TestTwiceSeries/testInt/testIncr/testIncr: tea_test.go:33: loaded from parent tests X = 2
TestTwiceSeries/testInt/testIncr/testIncr: tea_test.go:38: saving to future tests X = 3
=== RUN TestTwiceSeries/testInt/testIncr#01
TestTwiceSeries/testInt/testIncr#01: tea_test.go:20: saving to future tests X = 1
TestTwiceSeries/testInt/testIncr#01: tea_test.go:33: loaded from parent tests X = 1
TestTwiceSeries/testInt/testIncr#01: tea_test.go:38: saving to future tests X = 2
--- PASS: TestTwiceSeries (0.00s)
--- PASS: TestTwiceSeries/testInt (0.00s)
--- PASS: TestTwiceSeries/testInt/testIncr (0.00s)
--- PASS: TestTwiceSeries/testInt/testIncr/testIncr (0.00s)
--- PASS: TestTwiceSeries/testInt/testIncr#01 (0.00s)
PASS
ok github.com/jordanorelli/tea/examples/incr 0.002s

@ -7,15 +7,20 @@ import (
"testing" "testing"
) )
// testInt is a Test that does nothing. It always passes. It acts as a
// container for a value to be made available to future tests.
type testInt struct { type testInt struct {
// the "save" struct tag instructs tea to save this field for future tests. // the "save" struct tag instructs tea to save this field for future tests.
X int `tea:"save"` X int `tea:"save"`
} }
// Run satisfies the tea.Test interface so that testInt may be used as a
// tea.Test
func (test *testInt) Run(t *testing.T) { func (test *testInt) Run(t *testing.T) {
t.Logf("saving to future tests X = %d", test.X) t.Logf("saving to future tests X = %d", test.X)
} }
// testIncr
type testIncr struct { type testIncr struct {
// the "load" struct tag instructs tea to load the value of this field from // the "load" struct tag instructs tea to load the value of this field from
// previous tests in this run. Like before, we also use a "save" tag. // previous tests in this run. Like before, we also use a "save" tag.
@ -23,6 +28,7 @@ type testIncr struct {
expect int expect int
} }
// Run satisfies the tea.Test interface
func (test *testIncr) Run(t *testing.T) { func (test *testIncr) Run(t *testing.T) {
t.Logf("loaded from parent tests X = %d", test.X) t.Logf("loaded from parent tests X = %d", test.X)
test.X++ test.X++

Loading…
Cancel
Save