json: move _test.v files to vlib/json/tests/ (#22731)

This commit is contained in:
Hitalo Souza 2024-11-12 14:33:01 -04:00 committed by GitHub
parent 9de84888b3
commit 8ebbacecd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 1 additions and 1 deletions

View file

@ -1,22 +0,0 @@
import json
struct Test {
optional_string ?string
optional_array ?[]string
optional_struct_array ?[]string
optional_map ?map[string]string
}
fn test_main() {
test := Test{}
encoded := json.encode(test)
assert dump(encoded) == '{}'
test2 := Test{
optional_map: {
'foo': 'bar'
}
}
encoded2 := json.encode(test2)
assert dump(encoded2) == '{"optional_map":{"foo":"bar"}}'
}