MCPcopy Index your code
hub / github.com/go-python/gopy / TestHi

Function TestHi

main_test.go:130–269  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func TestHi(t *testing.T) {
131 // t.Parallel()
132 path := "_examples/hi"
133 testPkg(t, pkg{
134 path: path,
135 lang: features[path],
136 cmd: "build",
137 extras: nil,
138 want: []byte(`hi from go
139hello you from go
140working...
141worked for 2 hours
142working...
143working...
144worked for 4 hours
145--- doc(hi)...
146
147package hi exposes a few Go functions to be wrapped and used from Python.
148
149
150--- hi.Universe: 42
151--- hi.Version: 0.1
152--- hi.Debug(): False
153--- hi.Set_Debug(true)
154--- hi.Debug(): True
155--- hi.Set_Debug(false)
156--- hi.Debug(): False
157--- hi.Anon(): hi.Person{Name="<nobody>", Age=1}
158--- new anon: hi.Person{Name="you", Age=24}
159--- hi.Set_Anon(hi.NewPerson('you', 24))...
160--- hi.Anon(): hi.Person{Name="you", Age=24}
161--- doc(hi.Hi)...
162Hi()
163
164 Hi prints hi from Go
165
166--- hi.Hi()...
167--- doc(hi.Hello)...
168Hello(str s)
169
170 Hello prints a greeting from Go
171
172--- hi.Hello('you')...
173--- doc(hi.Add)...
174Add(int i, int j) int
175
176 Add returns the sum of its arguments.
177
178--- hi.Add(1, 41)...
17942
180--- hi.Concat('4', '2')...
18142
182--- hi.LookupQuestion(42)...
183Life, the Universe and Everything
184--- hi.LookupQuestion(12)...
185caught: Wrong answer: 12 != 42
186--- doc(hi.Person):
187Person is a simple struct

Callers

nothing calls this directly

Calls 1

testPkgFunction · 0.85

Tested by

no test coverage detected