Work around buggy test.
authorCyril Brulebois <cyril@debamax.com>
Mon, 13 Feb 2023 16:28:35 +0000 (17:28 +0100)
committerCyril Brulebois <cyril@debamax.com>
Wed, 15 Feb 2023 10:03:10 +0000 (10:03 +0000)
This test expects a year-less timestamp to be understood as being from
the current year. Except we're next year already!

Bump the expected year for the time being.

Gbp-Pq: Name 0012-work-around-buggy-testparse-test.patch

pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse_test.go

index 04b73073536f04e957c2bb35e3257f58f08b843e..bef3bde365d9fe4ef76cb83bd488de8a84f87575 100644 (file)
@@ -54,7 +54,7 @@ func TestTimestamp(t *testing.T) {
                currentYear bool
        }{
                {"May 20 09:33:54", "0000-05-20T09:33:54Z", "", false},
-               {"May 20 09:33:54", "2022-05-20T09:33:54Z", "", true},
+               {"May 20 09:33:54", "2023-05-20T09:33:54Z", "", true},
                {"May 20 09:33:54 2022", "2022-05-20T09:33:54Z", "", false},
                {"May  1 09:33:54 2022", "2022-05-01T09:33:54Z", "", false},
                {"May 01 09:33:54 2021", "2021-05-01T09:33:54Z", "", true},
@@ -257,7 +257,7 @@ func TestParse(t *testing.T) {
                },
                {
                        "<12>May 20 09:33:54 UDMPRO,a2edd0c6ae48,udm-1.10.0.3686 kernel: foo", expected{
-                               Timestamp: time.Date(2022, time.May, 20, 9, 33, 54, 0, time.UTC),
+                               Timestamp: time.Date(2023, time.May, 20, 9, 33, 54, 0, time.UTC),
                                Hostname:  "UDMPRO,a2edd0c6ae48,udm-1.10.0.3686",
                                Tag:       "kernel",
                                PID:       "",