MCPcopy Create free account
hub / github.com/arcjet/gravity / TestBasic

Function TestBasic

examples/basic/basic_test.go:23–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestBasic(t *testing.T) {
24 fac, err := NewBasicFactory(t.Context(), SlogLogger{}, Utils{})
25 if err != nil {
26 t.Fatal(err)
27 }
28 defer fac.Close(t.Context())
29
30 ins, err := fac.Instantiate(t.Context())
31 if err != nil {
32 t.Fatal(err)
33 }
34 defer ins.Close(t.Context())
35
36 message, err := ins.Hello(t.Context())
37 if err != nil {
38 t.Fatal(err)
39 }
40
41 const want = "Hello, world!"
42 if message != want {
43 t.Errorf("wanted: %s, but got: %s", want, message)
44 }
45}
46
47func TestNoPrimitiveCleanup(t *testing.T) {
48 fac, err := NewBasicFactory(t.Context(), SlogLogger{}, Utils{})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected