mesh/merge-gate head 52600ec7bd61 merged into trunk cdcba9ca7375 — pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes wi…
mesh/repo-check head 52600ec7bd61 merged into trunk cdcba9ca7375 — pass: its merge-check.sh passed
mesh/delivery delivered
32 lines
1006 B
Go
32 lines
1006 B
Go
package system
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/declaration"
|
|
)
|
|
|
|
// Every shape in the vocabulary is implemented by a host that claims to do everything.
|
|
//
|
|
// **Added because adding a shape and forgetting this was silent here and loud there.** The
|
|
// `network` shape parsed, validated, applied and removed, and a full host still refused every
|
|
// declaration containing one — correctly, because it does not do half a declaration. The count
|
|
// test above passed throughout: it checks what the language has, not what a host can do.
|
|
func TestAFullHostImplementsEveryShapeTheLanguageHas(t *testing.T) {
|
|
does := map[declaration.Type]bool{}
|
|
for _, s := range All() {
|
|
if s.Name() != "arch" {
|
|
continue
|
|
}
|
|
for _, shape := range s.Shapes() {
|
|
does[shape] = true
|
|
}
|
|
}
|
|
for _, shape := range declaration.Vocabulary() {
|
|
if !does[shape] {
|
|
t.Errorf("the language has %q and a full host cannot apply it, so every declaration "+
|
|
"carrying one is refused whole", shape)
|
|
}
|
|
}
|
|
}
|