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

Function TestValueTypeString

parser_test.go:2268–2289  ·  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

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