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

toml: fix memory corruption when returning new date/time types (#12507)

This commit is contained in:
Larpon
2021-11-19 19:35:11 +01:00
committed by GitHub
parent a894a6cf36
commit 1bbc73384c
3 changed files with 52 additions and 10 deletions

View File

@@ -56,17 +56,17 @@ fn test_dates() {
od_time := toml.Date{'1979-05-27'}
ld1 := toml_doc.value('ld1')
assert ld1.date() == od_time
// assert ld1.string() == '1979-05-27' // TODO memory corruption
assert ld1.string() == '1979-05-27'
// lt1 test section
mut ot_time := toml.Time{'07:32:00'}
lt1 := toml_doc.value('lt1')
assert lt1.time() == ot_time
// assert lt1.string() == '07:32:00' // TODO memory corruption
assert lt1.string() == '07:32:00'
// lt2 test section
ot_time = toml.Time{'00:32:00.999999'}
lt2 := toml_doc.value('lt2')
assert lt2.time() == ot_time
// assert lt2.string() == '00:32:00.999999' // TODO memory corruption
assert lt2.string() == '00:32:00.999999'
}