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

Function TestNoOptionalPrimitiveCleanup

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

Source from the content-addressed store, hash-verified

66}
67
68func TestNoOptionalPrimitiveCleanup(t *testing.T) {
69 fac, err := NewBasicFactory(t.Context(), SlogLogger{}, Utils{})
70 if err != nil {
71 t.Fatal(err)
72 }
73 defer fac.Close(t.Context())
74
75 ins, err := fac.Instantiate(t.Context())
76 if err != nil {
77 t.Fatal(err)
78 }
79 defer ins.Close(t.Context())
80
81 in := true
82 actual := ins.OptionalPrimitive(t.Context(), &in)
83 if actual == nil {
84 t.Fatal("expected non-nil option result")
85 }
86
87 const expected = true
88 if *actual != expected {
89 t.Errorf("expected: %t, but got: %t", expected, *actual)
90 }
91}
92
93func TestResultPrimitiveCleanup(t *testing.T) {
94 fac, err := NewBasicFactory(t.Context(), SlogLogger{}, Utils{})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected