route/vendor/github.com/magefile/mage/mg/errors_test.go

20 lines
389 B
Go
Raw Normal View History

2017-10-06 15:29:20 +00:00
package mg
import "testing"
func TestFatalExit(t *testing.T) {
expected := 99
code := ExitStatus(Fatal(expected))
if code != expected {
t.Fatalf("Expected code %v but got %v", expected, code)
}
}
func TestFatalfExit(t *testing.T) {
expected := 99
code := ExitStatus(Fatalf(expected, "boo!"))
if code != expected {
t.Fatalf("Expected code %v but got %v", expected, code)
}
}