1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 if len(os.Args) != 2 {
14 fatal("usage: callback testname")
18 fatal("unknown test %q", os.Args[1])
27 func fatal(f string, args ...any) {
28 fmt.Fprintln(os.Stderr, fmt.Sprintf(f, args...))
32 type GoCallback struct{}
34 func (p *GoCallback) Run() string {
35 return "GoCallback.Run"
44 if s != "Callback::run" {
45 fatal("unexpected string from Call: %q", s)
52 cb := NewDirectorCallback(&GoCallback{})
55 if s != "GoCallback.Run" {
56 fatal("unexpected string from Call with callback: %q", s)
59 DeleteDirectorCallback(cb)