When run as a stand-alone test (without other tests running before),
the builtin function 'assert' (only available for testing) is missing.
Make sure it's declared.
This change only affects this test, when run stand-alone, as in:
go test -run Hilbert
Fixes #60774.
Change-Id: Ib07d97ba2670b839e8ad11ef50d0e6581bb3d79d
Reviewed-on: https://go-review.googlesource.com/c/go/+/502996
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
"fmt"
"os"
"testing"
+
+ . "cmd/compile/internal/types2"
)
var (
return
}
+ DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
mustTypecheck(string(src), nil, nil)
}
"context.go": nil,
"context_test.go": nil,
"gccgosizes.go": nil,
- "hilbert_test.go": nil,
+ "hilbert_test.go": func(f *ast.File) { renameImportPath(f, `"cmd/compile/internal/types2"`, `"go/types"`) },
"infer.go": func(f *ast.File) {
fixTokenPos(f)
fixInferSig(f)
"fmt"
"os"
"testing"
+
+ . "go/types"
)
var (
return
}
+ DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
mustTypecheck(string(src), nil, nil)
}