func TestRegexPath_Error(t *testing.T) { pattern := `[0-9]++` matcherFunc := RegexPath(pattern) var ctx context.Context ctx = context_test.MakeTestContextWithPath("adam[23]") _, err := matcherFunc(ctx) assert.Error(t, err) }
func TestMapFromBase64StringWithError(t *testing.T) { base64String := "eyJuYW1lIjoiTWFasd0In0=" _, err := FromBase64(base64String) assert.Error(t, err) assert.Panics(t, func() { MustFromBase64(base64String) }) }
func TestMapFromSignedBase64StringWithError(t *testing.T) { base64String := "eyJuYW1lasdIjoiTWF0In0=_67ee82916f90b2c0d68c903266e8998c9ef0c3d6" _, err := FromSignedBase64(base64String, "key") assert.Error(t, err) assert.Panics(t, func() { MustFromSignedBase64(base64String, "key") }) }
func TestConversionSignedBase64WithError(t *testing.T) { o := MSI() o["test"] = func() {} assert.Panics(t, func() { o.MustSignedBase64("key") }) _, err := o.SignedBase64("key") assert.Error(t, err) }
func TestConversionBase64WithError(t *testing.T) { o := MSI() o["test"] = func() {} assert.Panics(t, func() { o.MustBase64() }) _, err := o.Base64() assert.Error(t, err) }
func TestConversionJSONWithError(t *testing.T) { o := MSI() o["test"] = func() {} assert.Panics(t, func() { o.MustJSON() }) _, err := o.JSON() assert.Error(t, err) }
func TestMapMustFromJSONWithError(t *testing.T) { _, err := FromJSON(`"name":"Mat"}`) assert.Error(t, err) }