Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
x
/
json2
/
tests
/
encode_option_test.v
13
lines
·
11
sloc
·
206 bytes
·
2bf590e90df6504edbba15369b39e8e8fcebf4b1
Raw
1
import
x.json2
2
3
struct
JoseHeader {
4
pub
mut
:
5
cty ?string
6
alg string
7
typ string =
'JWT'
8
}
9
10
fn
test_main() {
11
res := json2.encode(JoseHeader{ alg:
'HS256'
})
12
assert res ==
'{"alg":"HS256","typ":"JWT"}'
13
}
14