Skip to content

Commit 7166e75

Browse files
committed
test: fix test for running in different timezones
1 parent 8c7622a commit 7166e75

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

internal/cmd/parse_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ import (
1414
const (
1515

1616
// This is 1751770507 relative to a "now" of 2000-01-01 0:00
17-
afterOutput = `LOCALE DATE TIME
18-
Local Saturday, July 5, 2025 22:55:07-04:00
19-
UTC Sunday, July 6, 2025 02:55:07Z
17+
parseOutputBefore = `UTC Sunday, July 6, 2025 02:55:07Z
2018
2119
Relative: 223634h55m7s from now`
2220

2321
// This is 946080000 relative to a "now" of 2000-01-01 0:00
24-
beforeOutput = `LOCALE DATE TIME
25-
Local Friday, December 24, 1999 19:00:00-05:00
22+
parseOutputAfter = `
2623
UTC Saturday, December 25, 1999 00:00:00Z
2724
2825
Relative: 168h0m0s ago`
@@ -38,7 +35,8 @@ func Test_Parse(t *testing.T) {
3835
"1751770507\n",
3936
},
4037
expectedOutput: []string{
41-
afterOutput,
38+
"LOCALE DATE TIME",
39+
parseOutputBefore,
4240
},
4341
},
4442
{
@@ -48,7 +46,8 @@ func Test_Parse(t *testing.T) {
4846
},
4947
in: "1751770507\n",
5048
expectedOutput: []string{
51-
afterOutput,
49+
"LOCALE DATE TIME",
50+
parseOutputBefore,
5251
},
5352
},
5453
{
@@ -58,7 +57,8 @@ func Test_Parse(t *testing.T) {
5857
},
5958
in: "946080000\n",
6059
expectedOutput: []string{
61-
beforeOutput,
60+
"LOCALE DATE TIME",
61+
parseOutputAfter,
6262
},
6363
},
6464
{
@@ -69,7 +69,8 @@ func Test_Parse(t *testing.T) {
6969
},
7070
in: "1751770507\n",
7171
expectedOutput: []string{
72-
"{\"Epoch\":\"1751770507\",\"Locales\":[{\"Name\":\"Local\",\"Time\":\"2025-07-05T22:55:07-04:00\"},{\"Name\":\"UTC\",\"Time\":\"2025-07-06T02:55:07Z\"}],\"Now\":\"1999-12-31T19:00:00-05:00\"}",
72+
"{\"Epoch\":\"1751770507\"",
73+
",{\"Name\":\"UTC\",\"Time\":\"2025-07-06T02:55:07Z\"}],\"Now\":\"1999-12-31T19:00:00-05:00\"}",
7374
},
7475
},
7576
{

0 commit comments

Comments
 (0)