oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package wire
2
3import "testing"
4
5// UnprovenCount comes only with UnprovenProcessesLeft, is bounded, and an
6// older instance never sees either.
7func TestUnprovenCount(t *testing.T) {
8 for _, c := range []struct {
9 code string
10 n int
11 ok bool
12 }{
13 {UnprovenProcessesLeft, 3, true},
14 {UnprovenProcessesLeft, 0, false},
15 {UnprovenRecordIncomplete, 3, false},
16 {"", 3, false},
17 {UnprovenProcessesLeft, MaxUnprovenCount + 1, false},
18 {UnprovenProcessesLeft, -1, false},
19 } {
20 if err := ValidCapabilities(Capabilities{Unproven: c.code, UnprovenCount: c.n}); (err == nil) != c.ok {
21 t.Fatalf("%q %d: %v", c.code, c.n, err)
22 }
23 }
24 h := &Hello{Capabilities: &Capabilities{Unproven: UnprovenProcessesLeft, UnprovenCount: 3}}
25 if WithoutMacEngineering(h); h.Capabilities.Unproven != "" || h.Capabilities.UnprovenCount != 0 {
26 t.Fatalf("kept below 37: %+v", h.Capabilities)
27 }
28}
29