mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-10-04 12:31:00 +00:00
test: migrate most tests to testify
testify makes most bog-standard test checks much easier to read and maintain, and is quite widely used. It wasn't really well known back when go-mtree was first written, but the migration is fairly straight-forward for most tests. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This commit is contained in:
parent
f2b48a0e2f
commit
3252a4ad82
55 changed files with 22620 additions and 886 deletions
31
vendor/github.com/stretchr/testify/require/doc.go
generated
vendored
Normal file
31
vendor/github.com/stretchr/testify/require/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Package require implements the same assertions as the `assert` package but
|
||||
// stops test execution when a test fails.
|
||||
//
|
||||
// # Example Usage
|
||||
//
|
||||
// The following is a complete example using require in a standard test function:
|
||||
//
|
||||
// import (
|
||||
// "testing"
|
||||
// "github.com/stretchr/testify/require"
|
||||
// )
|
||||
//
|
||||
// func TestSomething(t *testing.T) {
|
||||
//
|
||||
// var a string = "Hello"
|
||||
// var b string = "Hello"
|
||||
//
|
||||
// require.Equal(t, a, b, "The two words should be the same.")
|
||||
//
|
||||
// }
|
||||
//
|
||||
// # Assertions
|
||||
//
|
||||
// The `require` package have same global functions as in the `assert` package,
|
||||
// but instead of returning a boolean result they call `t.FailNow()`.
|
||||
// A consequence of this is that it must be called from the goroutine running
|
||||
// the test function, not from other goroutines created during the test.
|
||||
//
|
||||
// Every assertion function also takes an optional string message as the final argument,
|
||||
// allowing custom error messages to be appended to the message the assertion method outputs.
|
||||
package require
|
Loading…
Add table
Add a link
Reference in a new issue