♻️ Add tools.WriteValue

This commit is contained in:
Dan Jones 2024-03-03 13:56:48 -06:00
commit 286ac4557d
4 changed files with 97 additions and 31 deletions

View file

@ -40,7 +40,7 @@ func TestMeta(t *testing.T) {
{"byte", "byteme", byte(67), "@byteme C", nil, "C"},
{"json-obj", "obj", json.RawMessage(`{"foo":"bar","baz":"quux"}`), `@obj {"foo":"bar","baz":"quux"}`, nil, json.RawMessage(`{"foo":"bar","baz":"quux"}`)},
{"json-arr", "arr", json.RawMessage(`["foo",42,"bar", null,"quux", true]`), `@arr ["foo",42,"bar", null,"quux", true]`, nil, json.RawMessage(`["foo",42,"bar", null,"quux", true]`)},
{"chan", "nope", make(chan bool), "", errors.New("Unknown type chan bool"), ""},
{"chan", "nope", make(chan bool), "", errors.New("Unsupported type chan bool"), ""},
{"whitespace-key", "no space", "hi", "", errors.New("whitespace is not allowed in key: no space"), ""},
{"empty-mar", "nope", skipMarshalTest, "", nil, ErrorParsing},
{"no-key-mar", "nope", skipMarshalTest, "nope", nil, ErrorParsing},