MCPcopy
hub / github.com/pocketbase/pocketbase / TestDateTimeAddDate

Function TestDateTimeAddDate

tools/types/datetime_test.go:108–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestDateTimeAddDate(t *testing.T) {
109 t.Parallel()
110
111 d1, _ := types.ParseDateTime("2024-01-01 10:00:00.123Z")
112
113 d2 := d1.AddDate(1, 2, 3)
114
115 if d1.String() != "2024-01-01 10:00:00.123Z" {
116 t.Fatalf("Expected d1 to remain unchanged, got %s", d1.String())
117 }
118
119 expected := "2025-03-04 10:00:00.123Z"
120 if d2.String() != expected {
121 t.Fatalf("Expected d2 %s, got %s", expected, d2.String())
122 }
123}
124
125func TestDateTimeAfter(t *testing.T) {
126 t.Parallel()

Callers

nothing calls this directly

Calls 3

ParseDateTimeFunction · 0.92
AddDateMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…