@@ -21,7 +21,7 @@ func TestScan(t *testing.T) {
2121
2222 fset := token .NewFileSet ()
2323
24- got := TestMain {Package : pkg }
24+ got := TestMain {Package : pkg . Package , Context : pkg . InternalBuildContext () }
2525 if err := got .Scan (fset ); err != nil {
2626 t .Fatalf ("Got: tm.Scan() returned error: %s. Want: no error." , err )
2727 }
@@ -47,6 +47,7 @@ func TestScan(t *testing.T) {
4747 }
4848 opts := cmp.Options {
4949 cmpopts .IgnoreFields (TestMain {}, "Package" ), // Inputs.
50+ cmpopts .IgnoreFields (TestMain {}, "Context" ),
5051 }
5152 if diff := cmp .Diff (want , got , opts ... ); diff != "" {
5253 t .Errorf ("List of test function is different from expected (-want,+got):\n %s" , diff )
@@ -66,7 +67,7 @@ func TestSynthesize(t *testing.T) {
6667 {
6768 descr : "all tests" ,
6869 tm : TestMain {
69- Package : pkg ,
70+ Package : pkg . Package ,
7071 Tests : []TestFunc {
7172 {Location : LocInPackage , Name : "TestXxx" },
7273 {Location : LocExternal , Name : "TestYyy" },
@@ -88,14 +89,14 @@ func TestSynthesize(t *testing.T) {
8889 }, {
8990 descr : "testmain" ,
9091 tm : TestMain {
91- Package : pkg ,
92+ Package : pkg . Package ,
9293 TestMain : & TestFunc {Location : LocInPackage , Name : "TestMain" },
9394 },
9495 wantSrc : testmain ,
9596 }, {
9697 descr : "import only" ,
9798 tm : TestMain {
98- Package : pkg ,
99+ Package : pkg . Package ,
99100 Examples : []ExampleFunc {
100101 {Location : LocInPackage , Name : "ExampleXxx" },
101102 },
0 commit comments