comparison src/testdir/test_functions.vim @ 20794:2e7acc208a1f v8.2.0949

patch 8.2.0949: strptime() does not use DST Commit: https://github.com/vim/vim/commit/ea1233fccf4f52f2b4eaab3788a087878d1336fc Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 10 16:54:13 2020 +0200 patch 8.2.0949: strptime() does not use DST Problem: Strptime() does not use DST. Solution: Set the tm_isdst field to -1. (Tom?? Janou?ek, closes https://github.com/vim/vim/issues/6230)
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Jun 2020 17:00:04 +0200
parents 5a9c42c6a69e
children 9c24319b4cb2
comparison
equal deleted inserted replaced
20793:d48f8bb5f34e 20794:2e7acc208a1f
277 let tz = $TZ 277 let tz = $TZ
278 endif 278 endif
279 let $TZ = 'UTC' 279 let $TZ = 'UTC'
280 280
281 call assert_equal(1484653763, strptime('%Y-%m-%d %T', '2017-01-17 11:49:23')) 281 call assert_equal(1484653763, strptime('%Y-%m-%d %T', '2017-01-17 11:49:23'))
282
283 " Force DST and check that it's considered
284 let $TZ = 'WINTER0SUMMER,J1,J365'
285 call assert_equal(1484653763 - 3600, strptime('%Y-%m-%d %T', '2017-01-17 11:49:23'))
282 286
283 call assert_fails('call strptime()', 'E119:') 287 call assert_fails('call strptime()', 'E119:')
284 call assert_fails('call strptime("xxx")', 'E119:') 288 call assert_fails('call strptime("xxx")', 'E119:')
285 call assert_equal(0, strptime("%Y", '')) 289 call assert_equal(0, strptime("%Y", ''))
286 call assert_equal(0, strptime("%Y", "xxx")) 290 call assert_equal(0, strptime("%Y", "xxx"))