28 lines
947 B
Go
28 lines
947 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/novox/mesh-controller/internal/catalogue"
|
|
)
|
|
|
|
// novox/hq issue 237: every line of an act's answer comes from one resolution of the node taken after
|
|
// its write, so the answer agrees with `plan` for the node right after.
|
|
|
|
func aProviderAndItsConsumer(t *testing.T, open *stores) {
|
|
t.Helper()
|
|
register(t, open, catalogue.Manifest{Module: "db", Version: "1",
|
|
Provides: []catalogue.Offer{{Name: "rows", Scope: catalogue.ScopeNode}}})
|
|
register(t, open, catalogue.Manifest{Module: "app", Version: "1", Requires: []string{"rows"}})
|
|
}
|
|
|
|
// twoRivalsAndANote is a node that does not resolve — two modules claim one node seat there — and a
|
|
// module beside them that changes nothing about it.
|
|
func twoRivalsAndANote(t *testing.T, open *stores) {
|
|
t.Helper()
|
|
one, two := rivals()
|
|
register(t, open, one)
|
|
register(t, open, two)
|
|
register(t, open, catalogue.Manifest{Module: "notes", Version: "1"})
|
|
}
|