v / vlib / toml / tests / json_encoding_test.v
15 lines · 11 sloc · 373 bytes · f6844e97661d55094833fd8a0e44589aeca62ebf
Raw
1import os
2import toml
3import toml.to
4
5const fprefix = os.join_path(os.dir(@FILE), 'testdata', os.file_name(@FILE).all_before_last('.'))
6
7fn test_parse() {
8 toml_doc := toml.parse_file(os.real_path(fprefix + '.toml'))!
9
10 toml_json := to.json(toml_doc)
11 println(toml_json)
12
13 out_file_json := os.read_file(os.real_path(fprefix + '.out'))!
14 assert toml_json == out_file_json
15}
16