The subfolders here match the example/pattern tag from the slides.
Unless otherwise stated, you can chdir
to the respective folders
below and run go test -v
You can also try running individual tests:
go test -v -run=TestAdderUsingTable
go test -v -run=TestAdderUsingSubtests
go test -v -run=TestAdderUsingSubtests/Positive
In addition to -v
, you can also add -d
and -w
switches.
-d
shows the Type and address of the instances under test per-test.
-w
shows before
and after
wrapper functions at Suite level and per-test
Run go test -v -d
for debug output.
Additionally, the code comments mention changes that can be made to simulate errors and obesrve behavior in the output
The code has commented t.Fatalf
lines which can be uncommented to
induce errors in both SETUP and TEARDOWN
These are variants with minor changes.
Lines that demonstrate behavior are printed directly. Just run go test -v
Lines that demonstrate behavior are printed directly. Just run go test -v