From 50034e9faac531e0e4d6cbf4d172462ca23c9be2 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Sat, 11 Nov 2023 12:07:25 -0800 Subject: [PATCH] go/types, types2: add FileVersions map to test Info Make sure the FileVersions map is populated in test runs. For #62605. Change-Id: I06585b5110a4a98b577edb8e03a4981b2484a5a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/541736 TryBot-Result: Gopher Robot Reviewed-by: Robert Findley Reviewed-by: Robert Griesemer Run-TryBot: Robert Griesemer Auto-Submit: Robert Griesemer --- src/cmd/compile/internal/types2/check_test.go | 15 ++++++++------- src/go/types/check_test.go | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/cmd/compile/internal/types2/check_test.go b/src/cmd/compile/internal/types2/check_test.go index f5c4103359..a9d6202a33 100644 --- a/src/cmd/compile/internal/types2/check_test.go +++ b/src/cmd/compile/internal/types2/check_test.go @@ -197,13 +197,14 @@ func testFilesImpl(t *testing.T, filenames []string, srcs [][]byte, colDelta uin // Provide Config.Info with all maps so that info recording is tested. info := Info{ - Types: make(map[syntax.Expr]TypeAndValue), - Instances: make(map[*syntax.Name]Instance), - Defs: make(map[*syntax.Name]Object), - Uses: make(map[*syntax.Name]Object), - Implicits: make(map[syntax.Node]Object), - Selections: make(map[*syntax.SelectorExpr]*Selection), - Scopes: make(map[syntax.Node]*Scope), + Types: make(map[syntax.Expr]TypeAndValue), + Instances: make(map[*syntax.Name]Instance), + Defs: make(map[*syntax.Name]Object), + Uses: make(map[*syntax.Name]Object), + Implicits: make(map[syntax.Node]Object), + Selections: make(map[*syntax.SelectorExpr]*Selection), + Scopes: make(map[syntax.Node]*Scope), + FileVersions: make(map[*syntax.PosBase]string), } // typecheck diff --git a/src/go/types/check_test.go b/src/go/types/check_test.go index b0fa131e5d..fc9723a67f 100644 --- a/src/go/types/check_test.go +++ b/src/go/types/check_test.go @@ -213,13 +213,14 @@ func testFilesImpl(t *testing.T, filenames []string, srcs [][]byte, manual bool, // Provide Config.Info with all maps so that info recording is tested. info := Info{ - Types: make(map[ast.Expr]TypeAndValue), - Instances: make(map[*ast.Ident]Instance), - Defs: make(map[*ast.Ident]Object), - Uses: make(map[*ast.Ident]Object), - Implicits: make(map[ast.Node]Object), - Selections: make(map[*ast.SelectorExpr]*Selection), - Scopes: make(map[ast.Node]*Scope), + Types: make(map[ast.Expr]TypeAndValue), + Instances: make(map[*ast.Ident]Instance), + Defs: make(map[*ast.Ident]Object), + Uses: make(map[*ast.Ident]Object), + Implicits: make(map[ast.Node]Object), + Selections: make(map[*ast.SelectorExpr]*Selection), + Scopes: make(map[ast.Node]*Scope), + FileVersions: make(map[*ast.File]string), } // typecheck -- 2.44.0