github.com/ipld/go-ipld-prime@v0.21.0/node/tests/testEngine.go (about)

     1  package tests
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/ipld/go-ipld-prime/datamodel"
     7  	"github.com/ipld/go-ipld-prime/schema"
     8  )
     9  
    10  // Engine describes the interface that can be supplied to run tests on schemas.
    11  //
    12  // The PrototypeByName function can get its job done using only interface types
    13  // that we already know from outside any generated code, so you can write tests
    14  // that have no _compile time_ dependency on the generated code.  This makes it
    15  // easier for IDEs and suchlike to help you write and check the test functions.
    16  //
    17  // Ask for prototypes using the type name alone (no package prefix);
    18  // their representation prototypes can be obtained by appending ".Repr".
    19  type Engine interface {
    20  	Init(t *testing.T, ts schema.TypeSystem)
    21  	PrototypeByName(name string) datamodel.NodePrototype
    22  }