MCPcopy Create free account
hub / github.com/buger/jsonparser / TestValueTypeString

Function TestValueTypeString

parser_test.go:2267–2288  ·  view source on GitHub ↗

Verifies: STK-REQ-001 [boundary] MCDC STK-REQ-001: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

2265// Verifies: STK-REQ-001 [boundary]
2266// MCDC STK-REQ-001: N/A
2267func TestValueTypeString(t *testing.T) {
2268 cases := []struct {
2269 value ValueType
2270 expected string
2271 }{
2272 {NotExist, "non-existent"},
2273 {String, "string"},
2274 {Number, "number"},
2275 {Object, "object"},
2276 {Array, "array"},
2277 {Boolean, "boolean"},
2278 {Null, "null"},
2279 {Unknown, "unknown"},
2280 {ValueType(255), "unknown"},
2281 }
2282
2283 for _, tc := range cases {
2284 if got := tc.value.String(); got != tc.expected {
2285 t.Fatalf("ValueType(%d).String() = %q, want %q", tc.value, got, tc.expected)
2286 }
2287 }
2288}
2289
2290// Verifies: STK-REQ-001 [boundary]
2291// MCDC STK-REQ-001: N/A

Callers

nothing calls this directly

Calls 2

ValueTypeTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected