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

Function TestBindStructs

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

Source from the content-addressed store, hash-verified

392}
393
394func TestBindStructs(t *testing.T) {
395 // t.Parallel()
396 path := "_examples/structs"
397 testPkg(t, pkg{
398 path: path,
399 lang: features[path],
400 cmd: "build",
401 extras: nil,
402 want: []byte(`s = structs.S()
403s = structs.S{handle=1}
404s.Init()
405s.Upper('boo')= 'BOO'
406s1 = structs.S1()
407s1 = structs.S1{handle=2}
408caught error: 'S1' object has no attribute 'private'
409s2 = structs.S2()
410s2 = structs.S2{Public=1, handle=5}
411s2 = structs.S2{Public=42, handle=7}
412s2.Public = 42
413caught error: 'S2' object has no attribute 'private'
414s2child = S2Child{S2: structs.S2{Public=42, handle=8, local=123}, local: 123}
415s2child.Public = 42
416s2child.local = 123
417caught error: 'S2Child' object has no attribute 'private'
418s3.X,Y = 3,4
419OK
420`),
421 })
422}
423
424func TestBindConsts(t *testing.T) {
425 // t.Parallel()

Callers

nothing calls this directly

Calls 1

testPkgFunction · 0.85

Tested by

no test coverage detected