carlos / platform Public

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

Plain git — no account needed to clone.

Download

Download this file

1package moves
2
3import "testing"
4
5func TestSwitchIsOffByDefault(t *testing.T) {
6 if DefaultEnabled {
7 t.Fatal("the Phase 1 switch must default to off until the copy record is approved")
8 }
9 env := map[string]string{}
10 get := func(k string) string { return env[k] }
11 if Enabled(get) {
12 t.Fatal("unset is off")
13 }
14 for _, v := range []string{"on", "1", "true"} {
15 env[SwitchEnv] = v
16 if !Enabled(get) {
17 t.Fatalf("%q should enable", v)
18 }
19 }
20 for _, v := range []string{"off", "0", "false", "yes", " on"} {
21 env[SwitchEnv] = v
22 if Enabled(get) {
23 t.Fatalf("%q should not enable", v)
24 }
25 }
26}
27