MCPcopy
hub / github.com/pocketbase/pocketbase / TestDateTimeString

Function TestDateTimeString

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

Source from the content-addressed store, hash-verified

291}
292
293func TestDateTimeString(t *testing.T) {
294 dt0 := types.DateTime{}
295 if dt0.String() != "" {
296 t.Fatalf("Expected empty string for zer datetime, got %q", dt0.String())
297 }
298
299 expected := "2022-01-01 11:23:45.678Z"
300 dt1, _ := types.ParseDateTime(expected)
301 if dt1.String() != expected {
302 t.Fatalf("Expected %q, got %v", expected, dt1)
303 }
304}
305
306func TestDateTimeMarshalJSON(t *testing.T) {
307 scenarios := []struct {

Callers

nothing calls this directly

Calls 3

StringMethod · 0.95
ParseDateTimeFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…