예제 #1
0
func TestComplex(t *testing.T) {
	t.Parallel()
	values := url.Values{}
	values.Add("status", "1")
	values.Add("server", "beta")
	values.Add("locale", "en_PI")
	expected := &rellenv.Env{
		Status: true,
		Env:    "beta",
	}
	env, _ := fromValues(t, values)
	ensure.Subset(t, env, expected)
	ensure.StringContains(t, env.SdkURL(), "en_PI")
}
예제 #2
0
func TestSubsetStruct(t *testing.T) {
	var c capture
	ensure.Subset(&c, typ{}, typ{Answer: 42})
	c.Equal(t, `ensure_test.go:104: expected subset not found:
ACTUAL:
(ensure_test.typ) {
 Answer: (int) 0
}

EXPECTED SUBSET
(ensure_test.typ) {
 Answer: (int) 42
}`)
}
예제 #3
0
func TestDefaultEnv(t *testing.T) {
	t.Parallel()
	env, _ := fromValues(t, url.Values{})
	ensure.Subset(t, env, defaultParser().Default())
}