mirror of
https://github.com/golang/go.git
synced 2026-04-02 09:20:29 +09:00
The parsers (cmd/compile/internal/syntax and go/parser) always accepted type parameters on methods for parser robustness but reported an error. With this change, the parsers accept the type parameters on methods, and then the type checkers (cmd/compile/internal/types2 and go/types) complain about them. Add test case for method type parameters when running the parsers only. Adjust some existing test cases as needed. This change is a necessary first step towards implementing generic methods but does not enable them. For #77273. Change-Id: I291fcf0aef0c917c74b32131c88b9e4ed71c5060 Reviewed-on: https://go-review.googlesource.com/c/go/+/738441 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
The test directory contains tests of the Go tool chain and runtime. It includes black box tests, regression tests, and error output tests. They are run as part of all.bash.
To run just these tests, execute:
../bin/go test cmd/internal/testdir
To run just tests from specified files in this directory, execute:
../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)'
Standard library tests should be written as regular Go tests in the appropriate package.
The tool chain and runtime also have regular Go tests in their packages. The main reasons to add a new test to this directory are:
- it is most naturally expressed using the test runner; or
- it is also applicable to
gccgoand other Go tool chains.