MCPcopy Create free account
hub / github.com/abice/go-enum / TestColorAppendText

Function TestColorAppendText

example/color_test.go:241–252  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

239}
240
241func TestColorAppendText(t *testing.T) {
242 input := ColorRedOrangeBlue
243 expected := "red-orange-blue"
244
245 a, err1 := input.AppendText(nil)
246 b, err2 := input.MarshalText()
247 require.NoError(t, err1, "AppendText should not return an error")
248 require.NoError(t, err2, "MarshalText should not return an error")
249 assert.Equal(t, expected, string(a), "AppendText should return the correct string")
250 assert.Equal(t, expected, string(b), "MarshalText should return the correct string")
251 assert.Equal(t, expected, input.String(), "String should return the correct string")
252}
253
254func BenchmarkColorParse(b *testing.B) {
255 knownItems := []string{

Callers

nothing calls this directly

Calls 3

AppendTextMethod · 0.45
MarshalTextMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…