From b6f885635661c6c519a019e05d31d24fff191e1d Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 17 Oct 2026 11:41:00 -0700 Subject: Use a more insane cookie format --- roseh.moe_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 roseh.moe_test.go (limited to 'roseh.moe_test.go') diff --git a/roseh.moe_test.go b/roseh.moe_test.go new file mode 100644 index 0000000..cf41cd0 --- /dev/null +++ b/roseh.moe_test.go @@ -0,0 +1,18 @@ +package main + +import ( + "testing" + "time" +) + +func TestMarshalTime(t *testing.T) { + now := time.Now().Truncate(time.Second) + b := marshalTime(now) + got, ok := unmarshalTime(b) + if !ok { + t.Fatalf("Failed round trip") + } + if !got.Equal(now) { + t.Errorf("Failed round trip. unmarshalTime(%v) = %v, want %v", b, got, now) + } +} -- cgit v1.3.1