Ejemplo n.º 1
0
func TestStringDoesNotContain(t *testing.T) {
	var c capture
	ensure.StringDoesNotContain(&c, "foo", "o")
	c.Equal(t, "ensure_test.go:148: substring \"o\" was not supposed to be found in \"foo\"")
	if log {
		t.Log("foo")
	}
}
Ejemplo n.º 2
0
func TestErrorStringWithoutStack(t *testing.T) {
	t.Parallel()
	h := newHarness(t)
	defer h.Stop()
	h.env.ErrorStack = false
	const message = "hello world"
	actual := errorString(h.env, stackerr.New(message))
	ensure.StringContains(t, actual, message)
	ensure.StringDoesNotContain(t, actual, ".go")
}