mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12: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
|
@ -1,28 +0,0 @@
|
|||
import json
|
||||
|
||||
struct User {
|
||||
name string
|
||||
}
|
||||
|
||||
struct MyStruct {
|
||||
user &User //
|
||||
users map[string]User
|
||||
users2 map[string]&User
|
||||
}
|
||||
|
||||
fn test_json_encode_with_ptr() {
|
||||
user := User{
|
||||
name: 'foo'
|
||||
}
|
||||
data := MyStruct{
|
||||
user: &user
|
||||
users: {
|
||||
'keyfoo': user
|
||||
}
|
||||
users2: {
|
||||
'keyfoo': &user
|
||||
}
|
||||
}
|
||||
|
||||
assert json.encode(data) == '{"user":{"name":"foo"},"users":{"keyfoo":{"name":"foo"}},"users2":{"keyfoo":{"name":"foo"}}}'
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue