carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package edge
2
3import (
4 "net/http/httptest"
5 "testing"
6)
7
8func TestAnswerFlagRoundTrip(t *testing.T) {
9 r := httptest.NewRequest("GET", "http://h/", nil)
10 MarkAnswered(r) // no flag: a no-op, never a panic
11 r, flag := WithAnswerFlag(r)
12 if *flag {
13 t.Fatal("flag must start false")
14 }
15 MarkAnswered(r)
16 if !*flag {
17 t.Fatal("MarkAnswered must set the flag the edge holds")
18 }
19}
20