mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
json: move _test.v
files to vlib/json/tests/
(#22731)
This commit is contained in:
parent
9de84888b3
commit
8ebbacecd6
37 changed files with 1 additions and 1 deletions
|
@ -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"}}'
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue