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

time: add test_parse_is8601_invalid (#7278)

This commit is contained in:
zakuro 2020-12-12 19:00:07 +09:00 committed by GitHub
parent 095327134e
commit df27a2b8d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,3 +106,23 @@ fn test_parse_iso8601_local() {
assert t.second == 6
assert t.microsecond == 15959
}
fn test_parse_iso8601_invalid() {
formats := [
'',
'2020-06-05X15:38:06.015959Z',
'2020-06-05T15:38:06.015959X',
'2020-06-05T15:38:06.015959+0000',
'2020-06-05T',
'2020-06-05Z',
'2020-06-05+00:00',
'15:38:06',
]
for format in formats {
time.parse_iso8601(format) or {
assert true
continue
}
assert false
}
}