ipld-eth-server/vendor/github.com/aristanetworks/goarista/test/panic_test.go
Matt K 293dd2e848 Add vendor dir (#16) (#4)
* Add vendor dir so builds dont require dep

* Pin specific version go-eth version
2018-01-29 13:44:18 -06:00

34 lines
692 B
Go

// Copyright (c) 2015 Arista Networks, Inc.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the COPYING file.
package test
import (
"testing"
)
func TestShouldPanic(t *testing.T) {
fn := func() { panic("Here we are") }
ShouldPanic(t, fn)
}
func TestShouldPanicWithString(t *testing.T) {
fn := func() { panic("Here we are") }
ShouldPanicWith(t, "Here we are", fn)
}
func TestShouldPanicWithInt(t *testing.T) {
fn := func() { panic(42) }
ShouldPanicWith(t, 42, fn)
}
func TestShouldPanicWithStruct(t *testing.T) {
fn := func() { panic(struct{ foo string }{foo: "panic"}) }
ShouldPanicWith(t, struct{ foo string }{foo: "panic"}, fn)
}