2021-11-16 09:41:37 +03:00
|
|
|
import os
|
|
|
|
import toml
|
2021-11-18 14:27:59 +03:00
|
|
|
import toml.to
|
2021-11-16 09:41:37 +03:00
|
|
|
|
2022-03-19 00:32:06 +03:00
|
|
|
const fprefix = os.join_path(os.dir(@FILE), 'testdata', os.file_name(@FILE).all_before_last('.'))
|
|
|
|
|
|
|
|
fn test_parse() ? {
|
2022-05-13 06:56:21 +03:00
|
|
|
toml_doc := toml.parse_file(os.real_path(fprefix + '.toml'))?
|
2021-11-16 09:41:37 +03:00
|
|
|
|
2021-11-18 14:27:59 +03:00
|
|
|
toml_json := to.json(toml_doc)
|
2021-11-16 09:41:37 +03:00
|
|
|
println(toml_json)
|
2022-03-19 00:32:06 +03:00
|
|
|
|
2022-05-13 06:56:21 +03:00
|
|
|
out_file_json := os.read_file(os.real_path(fprefix + '.out'))?
|
2021-11-16 09:41:37 +03:00
|
|
|
assert toml_json == out_file_json
|
|
|
|
}
|