1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:40:22 -07:00

cmd/compile/internal/types2: review of stdlib_test.go

The changes between (equivalent, and reviewed) go/types/stdlib_test.go
and stdlib_test.go can be seen by comparing patchset 1 and 2. The actual
changes are removing the "// UNREVIEWED" marker, using the os package
instead of ioutil, and some comment adjustments. Also, bug251.go passes
because of recent changes.

The primary difference is in the firstComment function which
doesn't have access to a scanner and instead uses the syntax
package's CommentsDu function.

Change-Id: I946ffadc97e87c692f76f369a1b16cceee528477
Reviewed-on: https://go-review.googlesource.com/c/go/+/304130
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2021-03-23 12:30:18 -07:00
parent ddcdbb417b
commit dec3d00b28

View File

@ -1,4 +1,3 @@
// UNREVIEWED
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@ -14,7 +13,6 @@ import (
"fmt"
"go/build"
"internal/testenv"
"io/ioutil"
"os"
"path/filepath"
"runtime"
@ -91,7 +89,7 @@ func firstComment(filename string) (first string) {
}
func testTestDir(t *testing.T, path string, ignore ...string) {
files, err := ioutil.ReadDir(path)
files, err := os.ReadDir(path)
if err != nil {
t.Fatal(err)
}
@ -184,17 +182,16 @@ func TestStdFixed(t *testing.T) {
"bug248.go", "bug302.go", "bug369.go", // complex test instructions - ignore
"issue6889.go", // gc-specific test
"issue11362.go", // canonical import path check
"issue16369.go", // go/types handles this correctly - not an issue
"issue18459.go", // go/types doesn't check validity of //go:xxx directives
"issue18882.go", // go/types doesn't check validity of //go:xxx directives
"issue20529.go", // go/types does not have constraints on stack size
"issue22200.go", // go/types does not have constraints on stack size
"issue22200b.go", // go/types does not have constraints on stack size
"issue25507.go", // go/types does not have constraints on stack size
"issue20780.go", // go/types does not have constraints on stack size
"issue42058a.go", // go/types does not have constraints on channel element size
"issue42058b.go", // go/types does not have constraints on channel element size
"bug251.go", // issue #34333 which was exposed with fix for #34151
"issue16369.go", // types2 handles this correctly - not an issue
"issue18459.go", // types2 doesn't check validity of //go:xxx directives
"issue18882.go", // types2 doesn't check validity of //go:xxx directives
"issue20529.go", // types2 does not have constraints on stack size
"issue22200.go", // types2 does not have constraints on stack size
"issue22200b.go", // types2 does not have constraints on stack size
"issue25507.go", // types2 does not have constraints on stack size
"issue20780.go", // types2 does not have constraints on stack size
"issue42058a.go", // types2 does not have constraints on channel element size
"issue42058b.go", // types2 does not have constraints on channel element size
)
}
@ -298,7 +295,7 @@ func (w *walker) walk(dir string) {
return
}
fis, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
w.errh(err)
return
@ -318,9 +315,9 @@ func (w *walker) walk(dir string) {
}
// traverse subdirectories, but don't walk into testdata
for _, fi := range fis {
if fi.IsDir() && fi.Name() != "testdata" {
w.walk(filepath.Join(dir, fi.Name()))
for _, f := range files {
if f.IsDir() && f.Name() != "testdata" {
w.walk(filepath.Join(dir, f.Name()))
}
}
}