mirror of
https://github.com/golang/go
synced 2024-11-23 05:30:07 -07:00
go/types, types2: fix Hilbert test for stand-alone run
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>
This commit is contained in:
parent
9efa625d84
commit
dac75b6675
@ -10,6 +10,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
. "cmd/compile/internal/types2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -25,6 +27,7 @@ func TestHilbert(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
|
||||||
mustTypecheck(string(src), nil, nil)
|
mustTypecheck(string(src), nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ var filemap = map[string]action{
|
|||||||
"context.go": nil,
|
"context.go": nil,
|
||||||
"context_test.go": nil,
|
"context_test.go": nil,
|
||||||
"gccgosizes.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) {
|
"infer.go": func(f *ast.File) {
|
||||||
fixTokenPos(f)
|
fixTokenPos(f)
|
||||||
fixInferSig(f)
|
fixInferSig(f)
|
||||||
|
@ -12,6 +12,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
. "go/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -27,6 +29,7 @@ func TestHilbert(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefPredeclaredTestFuncs() // declare assert (used by code generated by verify)
|
||||||
mustTypecheck(string(src), nil, nil)
|
mustTypecheck(string(src), nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user