package handlers import "testing" func TestValidPairCode(t *testing.T) { tests := []struct { name string code string want bool }{ {name: "valid", code: "AB23CD", want: true}, {name: "ambiguous characters rejected", code: "AB01CD", want: false}, {name: "lowercase rejected before normalization", code: "ab12cd", want: false}, {name: "wrong length", code: "AB12C", want: false}, {name: "unicode rejected", code: "AB12CD", want: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := validPairCode(tt.code); got != tt.want { t.Fatalf("validPairCode(%q) = %v, want %v", tt.code, got, tt.want) } }) } }