1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
package _generated
import (
"bytes"
"os"
"testing"
)
// Issue 94: shims were not propogated recursively,
// which caused shims that weren't at the top level
// to be silently ignored.
//
// The following line will generate an error after
// the code is generated if the generated code doesn't
// have the right identifier in it.
func TestIssue94(t *testing.T) {
b, err := os.ReadFile("issue94_gen.go")
if err != nil {
t.Fatal(err)
}
const want = "timetostr"
if !bytes.Contains(b, []byte(want)) {
t.Errorf("generated code did not contain %q", want)
}
}
|