mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: make error handling the same as the main function (#15825)
This commit is contained in:
@ -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'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import time
|
||||
|
||||
fn test_add_to_day_in_the_previous_century() ? {
|
||||
fn test_add_to_day_in_the_previous_century() {
|
||||
a := time.parse_iso8601('1900-01-01')?
|
||||
aa := a.add_days(180)
|
||||
dump(a.debug())
|
||||
@ -8,25 +8,25 @@ fn test_add_to_day_in_the_previous_century() ? {
|
||||
assert aa.ymmdd() == '1900-06-30'
|
||||
}
|
||||
|
||||
fn test_add_to_day_in_the_past() ? {
|
||||
fn test_add_to_day_in_the_past() {
|
||||
a := time.parse_iso8601('1990-03-01')?
|
||||
aa := a.add_days(180)
|
||||
assert aa.ymmdd() == '1990-08-28'
|
||||
}
|
||||
|
||||
fn test_add_to_day_in_the_recent_past() ? {
|
||||
fn test_add_to_day_in_the_recent_past() {
|
||||
a := time.parse_iso8601('2021-03-01')?
|
||||
aa := a.add_days(180)
|
||||
assert aa.ymmdd() == '2021-08-28'
|
||||
}
|
||||
|
||||
fn test_add_to_day_in_the_future_1() ? {
|
||||
fn test_add_to_day_in_the_future_1() {
|
||||
a := time.parse_iso8601('3000-11-01')?
|
||||
aa := a.add_days(180)
|
||||
assert aa.ymmdd() == '3001-04-30'
|
||||
}
|
||||
|
||||
fn test_add_to_day_in_the_future_2() ? {
|
||||
fn test_add_to_day_in_the_future_2() {
|
||||
a := time.parse_iso8601('3000-12-30')?
|
||||
aa := a.add_days(180)
|
||||
assert aa.ymmdd() == '3001-06-28'
|
||||
|
Reference in New Issue
Block a user