diff options
author | Indrajith K L | 2022-12-03 17:00:20 +0530 |
---|---|---|
committer | Indrajith K L | 2022-12-03 17:00:20 +0530 |
commit | f5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch) | |
tree | 2764fc62da58f2ba8da7ed341643fc359873142f /v_windows/v/vlib/time/time_addition_test.v | |
download | cli-tools-windows-master.tar.gz cli-tools-windows-master.tar.bz2 cli-tools-windows-master.zip |
Diffstat (limited to 'v_windows/v/vlib/time/time_addition_test.v')
-rw-r--r-- | v_windows/v/vlib/time/time_addition_test.v | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/v_windows/v/vlib/time/time_addition_test.v b/v_windows/v/vlib/time/time_addition_test.v new file mode 100644 index 0000000..8fde874 --- /dev/null +++ b/v_windows/v/vlib/time/time_addition_test.v @@ -0,0 +1,33 @@ +import time + +fn test_add_to_day_in_the_previous_century() ? { + a := time.parse_iso8601('1900-01-01') ? + aa := a.add_days(180) + dump(a.debug()) + dump(aa.debug()) + assert aa.ymmdd() == '1900-06-29' +} + +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-27' +} + +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() ? { + 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() ? { + a := time.parse_iso8601('3000-12-30') ? + aa := a.add_days(180) + assert aa.ymmdd() == '3001-06-28' +} |