summaryrefslogtreecommitdiffstats
path: root/roseh.moe_test.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2026-10-17 11:41:00 -0700
committerRose Hogenson <rosehogenson@posteo.net>2026-10-17 11:41:16 -0700
commitb6f885635661c6c519a019e05d31d24fff191e1d (patch)
treee7a260b2eb233826ba612a4956202112c639479b /roseh.moe_test.go
parentMake the 404 image not quite so ass (diff)
downloadroseh.moe-b6f885635661c6c519a019e05d31d24fff191e1d.tar.zst
Use a more insane cookie format
Diffstat (limited to 'roseh.moe_test.go')
-rw-r--r--roseh.moe_test.go18
1 files changed, 18 insertions, 0 deletions
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)
+ }
+}