Пример #1
0
func TestGetMux(t *testing.T) {
	ep := testEndpoint()
	_, err := ep(perm.WithMux(nil, perm.NewMux()), nil)
	if err != nil {
		t.Errorf("test error: %#v", err.Error())
	}
}
Пример #2
0
func TestGetFail(t *testing.T) {
	ep := testEndpoint()
	_, err := ep(perm.WithMux(nil, nil), nil)
	if err == nil {
		t.Error("unable to raise error when no perm.Mux in context")
	} else if want, have := "unable to get perm.Mux", err.Error(); want != have {
		t.Errorf("want: %#v, got: %#v", want, have)
	}
}