@@ -172,22 +172,26 @@ func TestImportTypeparamTests(t *testing.T) {
172
172
t .Skipf ("gc-built packages not available (compiler = %s)" , runtime .Compiler )
173
173
}
174
174
175
- testAliases (t , testImportTypeparamTests )
175
+ testAliases (t , func (t * testing.T ) {
176
+ var skip map [string ]string
177
+
178
+ // Add tests to skip.
179
+ if testenv .Go1Point () == 22 && os .Getenv ("GODEBUG" ) == aliasesOn {
180
+ // The tests below can be skipped in 1.22 as gotypesalias=1 was experimental.
181
+ // These do not need to be addressed.
182
+ skip = map [string ]string {
183
+ "struct.go" : "1.22 differences in formatting a *types.Alias" ,
184
+ "issue50259.go" : "1.22 cannot compile due to an understood types.Alias bug" ,
185
+ }
186
+ }
187
+ testImportTypeparamTests (t , skip )
188
+ })
176
189
}
177
190
178
- func testImportTypeparamTests (t * testing.T ) {
191
+ func testImportTypeparamTests (t * testing.T , skip map [ string ] string ) {
179
192
tmpdir := mktmpdir (t )
180
193
defer os .RemoveAll (tmpdir )
181
194
182
- // GoVersion -> GoDebug -> filename -> reason to skip
183
- skips := map [int ]map [string ]map [string ]string {
184
- 22 : {aliasesOn : {
185
- "issue50259.go" : "internal compiler error: unexpected types2.Invalid" ,
186
- "struct.go" : "badly formatted expectation E[int]" ,
187
- }},
188
- }
189
- dbg , version := os .Getenv ("GODEBUG" ), testenv .Go1Point ()
190
-
191
195
// Check go files in test/typeparam, except those that fail for a known
192
196
// reason.
193
197
rootDir := filepath .Join (runtime .GOROOT (), "test" , "typeparam" )
@@ -203,9 +207,8 @@ func testImportTypeparamTests(t *testing.T) {
203
207
}
204
208
205
209
t .Run (entry .Name (), func (t * testing.T ) {
206
- if reason := skips [version ][dbg ][entry .Name ()]; reason != "" {
207
- t .Skipf ("Skipping file %q with GODEBUG=%q due to %q at version 1.%d" ,
208
- entry .Name (), dbg , reason , version )
210
+ if reason := skip [entry .Name ()]; reason != "" {
211
+ t .Skipf ("Skipping due to %s" , reason )
209
212
}
210
213
211
214
filename := filepath .Join (rootDir , entry .Name ())
0 commit comments