MCPcopy Create free account
hub / github.com/OpenPrinting/goipp / TestTypeString

Function TestTypeString

type_test.go:14–45  ·  view source on GitHub ↗

TestTypeString tests Type.String function

(t *testing.T)

Source from the content-addressed store, hash-verified

12
13// TestTypeString tests Type.String function
14func TestTypeString(t *testing.T) {
15 type testData struct {
16 ty Type // Input Type
17 s string // Expected output string
18 }
19
20 tests := []testData{
21 {TypeInvalid, "Invalid"},
22 {TypeVoid, "Void"},
23 {TypeBoolean, "Boolean"},
24 {TypeString, "String"},
25 {TypeDateTime, "DateTime"},
26 {TypeResolution, "Resolution"},
27 {TypeRange, "Range"},
28 {TypeTextWithLang, "TextWithLang"},
29 {TypeBinary, "Binary"},
30 {TypeCollection, "Collection"},
31 {0x1234, "0x1234"},
32 }
33
34 for _, test := range tests {
35 s := test.ty.String()
36 if s != test.s {
37 t.Errorf("testing Type.String:\n"+
38 "input: %d\n"+
39 "expected: %s\n"+
40 "present: %s\n",
41 int(test.ty), test.s, s,
42 )
43 }
44 }
45}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected