v2 / vlib / x / json2 / tests / autofree_json_test.v
13 lines · 11 sloc · 296 bytes · dd4efe6b3a1e24b1dfbf0ae749dc4ced89b5b50d
Raw
1// vtest build: !sanitize-memory-gcc && !sanitize-address-gcc && !sanitize-address-clang
2// vtest vflags: -autofree
3import x.json2
4
5struct Config {
6 bbb bool
7}
8
9fn test_compilation_with_autofree() {
10 cfg := Config{}
11 s := json2.encode(cfg, prettify: true)
12 assert s == '{\n "bbb": false\n}'
13}
14