1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: streamline scanner.at() return type, fixes #12344 (#12370)

This commit is contained in:
Larpon
2021-11-03 09:18:09 +01:00
committed by GitHub
parent bd5e2db460
commit 45c938bdec
2 changed files with 25 additions and 12 deletions

View File

@ -79,3 +79,14 @@ fn test_hex_values() {
assert value as i64 == 11
assert value.i64() == 11
}
fn test_comment_as_last_value() {
toml_txt := '
test = 42
# this line has comment as last thing'
toml_doc := toml.parse(toml_txt) or { panic(err) }
value := toml_doc.value('test')
assert value as i64 == 42
assert value.i64() == 42
}