File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1488,3 +1488,26 @@ func TestListPackages(t *testing.T) {
14881488 }
14891489 })
14901490}
1491+
1492+ func TestSubstitutePathAndList (t * testing.T ) {
1493+ // checks that substitute path rules do not remain cached after a -clear.
1494+ // See issue #3565.
1495+ withTestTerminal ("math" , t , func (term * FakeTerminal ) {
1496+ term .MustExec ("break main.main" )
1497+ term .MustExec ("continue" )
1498+ fixturesDir , _ := filepath .Abs (test .FindFixturesDir ())
1499+ term .MustExec ("config substitute-path " + fixturesDir + " /blah" )
1500+ out , _ := term .Exec ("list" )
1501+ t .Logf ("list output %s" , out )
1502+ if ! strings .Contains (out , "/blah/math.go" ) {
1503+ t .Fatalf ("bad output" )
1504+ }
1505+ term .MustExec ("config substitute-path -clear" )
1506+ term .MustExec ("config substitute-path " + fixturesDir + " /blah2" )
1507+ out , _ = term .Exec ("list" )
1508+ t .Logf ("list output %s" , out )
1509+ if ! strings .Contains (out , "/blah2/math.go" ) {
1510+ t .Fatalf ("bad output" )
1511+ }
1512+ })
1513+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111)
1212
1313func configureCmd (t * Term , ctx callContext , args string ) error {
14+ t .substitutePathRulesCache = nil
1415 switch args {
1516 case "-list" :
1617 return configureList (t )
You can’t perform that action at this time.
0 commit comments