cmd/compile/internal/syntax: use .go suffix for test files (cleanup)

- Use .go suffix for test files as go fmt doesn't descend into testdata
directories.
- Move test files from testdata/go2 into testdata directory.
- Delete some test files that contained type-checker ERROR markers that
  were ignored by the TestParseGo2 test but would be considered by the
  TestSyntaxErrors test if the files were moved unchanged into the
  testdata directory.
- Remove one (type checker) ERROR marker in testdata/slices.go to make
  it pass the syntax error tests.
- Delete TestParseGo2 test. There's enough coverage with the existing
  TestSyntaxErrors test.
- Add missing copyright notice to testdata/chans.go and gofmt the file.

Change-Id: I449913fe1bd2119987ba33f7152e5e4ba5f3fe31
Reviewed-on: https://go-review.googlesource.com/c/go/+/396518
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Robert Griesemer 2022-03-29 16:58:49 -07:00
parent c05c0ca8cf
commit 717056da1a
26 changed files with 9 additions and 769 deletions

View file

@ -129,7 +129,7 @@ func testSyntaxErrors(t *testing.T, filename string) {
defer f.Close()
var mode Mode
if strings.HasSuffix(filename, ".go2") {
if !strings.HasSuffix(filename, ".go117") {
mode = AllowGenerics
}
ParseFile(filename, func(err error) {