package cerror import ( "testing" "git.twelvetwelve.org/library/core/testutil/assert" ) func TestError_Errors(t *testing.T) { c := NewCode("org.twelvetwelve.one") assert.NotNil(t, c) e := New(c, "something went wrong") assert.NotNil(t, e) assert.Equal(t, e.Code(), c) assert.WillPanic(t, func() { _ = NewCode("org.twelvetwelve.one") }) assert.WillPanic(t, func() { _ = GetCode("org.twelvetwelve.two") }) c2 := NewCode("org.twelvetwelve.two") assert.NotNil(t, c2) assert.NotEqual(t, c, c2) }