tests: make error handling the same as the main function (#15825)

This commit is contained in:
yuyi 2022-09-22 00:45:43 +08:00 committed by GitHub
parent 391ac12fe2
commit 41dbd12bc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 193 additions and 192 deletions

View file

@ -185,14 +185,14 @@ fn test_parse_rfc3339() {
}
}
fn test_ad_second_to_parse_result_in_2001() ? {
fn test_ad_second_to_parse_result_in_2001() {
now_tm := time.parse('2001-01-01 04:00:00')?
future_tm := now_tm.add_seconds(60)
assert future_tm.str() == '2001-01-01 04:01:00'
assert now_tm.unix < future_tm.unix
}
fn test_ad_second_to_parse_result_pre_2001() ? {
fn test_ad_second_to_parse_result_pre_2001() {
now_tm := time.parse('2000-01-01 04:00:00')?
future_tm := now_tm.add_seconds(60)
assert future_tm.str() == '2000-01-01 04:01:00'