mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: fix repetitive time.now().local().local().local() offsetting the time further and further (#13861)
This commit is contained in:
@ -254,3 +254,12 @@ fn test_since() {
|
||||
d2 := time.since(t1)
|
||||
assert d2 >= 40_000_000
|
||||
}
|
||||
|
||||
// issue relate https://github.com/vlang/v/issues/13828
|
||||
// problem: the local method add 2h on the time in a Linux machine
|
||||
// the other machine are not tested in a local env
|
||||
fn test_recursive_local_call() {
|
||||
now_tm := time.now()
|
||||
assert now_tm.str() == now_tm.local().str()
|
||||
assert now_tm.local().str() == now_tm.local().local().str()
|
||||
}
|
||||
|
Reference in New Issue
Block a user