From 5c583a86165e0c4fd33e3d2fdf70ccdb8edb9908 Mon Sep 17 00:00:00 2001 From: Vlad <52591095+MeanderingProgrammer@users.noreply.github.com> Date: Fri, 10 Oct 2025 23:03:02 -0700 Subject: [PATCH] test(plugin/shada_spec): always use UTC formatted date (#36128) Problem Similar to https://github.com/neovim/neovim/pull/33257, but for the date component. When timezone is behind UTC the epoch date of individual components mismatch causing the test to fail. Solution The `epoch` variable is created using `os.date` with a `!`, which means format the date in UTC instead of local timezone: https://www.lua.org/manual/5.1/manual.html#pdf-os.date. Since the individual components like year, month, and day are expected to match `epoch` they should all be created using a `!` as well. (cherry picked from commit f0b9232ad80804d85395130c54f1b8f671582c2c) --- test/functional/plugin/shada_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua index d1cc2b5ff7..66a6ac778f 100644 --- a/test/functional/plugin/shada_spec.lua +++ b/test/functional/plugin/shada_spec.lua @@ -3166,9 +3166,9 @@ describe('syntax/shada.vim', function() return { { 'ShaDaEntryHeader', 'ShaDaEntryTimestamp' }, s } end local synepoch = { - year = htsnum(os.date('%Y', 0)), - month = htsnum(os.date('%m', 0)), - day = htsnum(os.date('%d', 0)), + year = htsnum(os.date('!%Y', 0)), + month = htsnum(os.date('!%m', 0)), + day = htsnum(os.date('!%d', 0)), hour = htsnum(os.date('!%H', 0)), minute = htsnum(os.date('!%M', 0)), second = htsnum(os.date('!%S', 0)),