Smarty Blog - July 2018

Let's build an xUnit-style test runner for Go!Arrow Icon
Why? What do you mean 'why'? Because we can! What's wrong with you?
July 2, 2018 - Writing test functions in Go is easy: go package stuff import "testing" func TestStuff(t testing. T) { t. Log("Hello, World!") } Running test functions is also easy: $ go test -v === RUN TestStuff --- PASS: TestStuff (0. 00s) stuff_test. go:6: Hello, World! PASS ok github. com/smartystreets/stuff 0. 006s Preparing shared state for multiple test functions is problematic. The usual recommendation is to use table-drive tests. But this approach has its limits. For us, xUnit is the ideal solution.
View Blog Tags

The leader in location data intelligence

Ready to get started?