mirror of
https://github.com/vlang/v.git
synced 2025-09-14 15:02:33 +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
19
vlib/json/tests/json_encode_recursive_ptr_test.v
Normal file
19
vlib/json/tests/json_encode_recursive_ptr_test.v
Normal file
|
@ -0,0 +1,19 @@
|
|||
import json
|
||||
|
||||
struct PostTag {
|
||||
id string
|
||||
parent ?&PostTag
|
||||
visibility string
|
||||
created_at string @[json: 'createdAt']
|
||||
metadata string @[raw]
|
||||
}
|
||||
|
||||
fn test_main() {
|
||||
new_post_tag := &PostTag{}
|
||||
assert json.encode(new_post_tag) == '{"id":"","visibility":"","createdAt":"","metadata":""}'
|
||||
|
||||
new_post_tag2 := PostTag{
|
||||
parent: new_post_tag
|
||||
}
|
||||
assert json.encode(new_post_tag2) == '{"id":"","parent":{"id":"","visibility":"","createdAt":"","metadata":""},"visibility":"","createdAt":"","metadata":""}'
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue