| 515 | } |
| 516 | |
| 517 | func TestBindInterfaces(t *testing.T) { |
| 518 | // t.Parallel() |
| 519 | path := "_examples/iface" |
| 520 | // NOTE: python2 outputs this in a different order, so test fails, but results are the same |
| 521 | testPkg(t, pkg{ |
| 522 | path: path, |
| 523 | lang: features[path], |
| 524 | cmd: "build", |
| 525 | extras: nil, |
| 526 | want: []byte(`t.F [CALLED] |
| 527 | iface.CallIface... |
| 528 | t.F [CALLED] |
| 529 | iface.CallIface... [DONE] |
| 530 | iface as string: test string |
| 531 | iface as string: 42 |
| 532 | iface as handle: &{0 } |
| 533 | iface as handle: <nil> |
| 534 | doc(iface): '\npackage iface tests various aspects of interfaces.\n\n' |
| 535 | t = iface.T() |
| 536 | t.F() |
| 537 | iface.CallIface(t) |
| 538 | iface.IfaceString("test string" |
| 539 | iface.IfaceString(str(42)) |
| 540 | iface.IfaceHandle(t) |
| 541 | iface.IfaceHandle(go.nil) |
| 542 | OK |
| 543 | `), |
| 544 | }) |
| 545 | } |
| 546 | |
| 547 | func TestBindCgoPackage(t *testing.T) { |
| 548 | // t.Parallel() |