File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1488,3 +1488,29 @@ 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+ if runtime .GOOS == "windows" {
1496+ t .Skip ("test is not valid on windows due to path separators" )
1497+ }
1498+ withTestTerminal ("math" , t , func (term * FakeTerminal ) {
1499+ term .MustExec ("break main.main" )
1500+ term .MustExec ("continue" )
1501+ fixturesDir , _ := filepath .Abs (test .FindFixturesDir ())
1502+ term .MustExec ("config substitute-path " + fixturesDir + " /blah" )
1503+ out , _ := term .Exec ("list" )
1504+ t .Logf ("list output %s" , out )
1505+ if ! strings .Contains (out , "/blah/math.go" ) {
1506+ t .Fatalf ("bad output" )
1507+ }
1508+ term .MustExec ("config substitute-path -clear" )
1509+ term .MustExec ("config substitute-path " + fixturesDir + " /blah2" )
1510+ out , _ = term .Exec ("list" )
1511+ t .Logf ("list output %s" , out )
1512+ if ! strings .Contains (out , "/blah2/math.go" ) {
1513+ t .Fatalf ("bad output" )
1514+ }
1515+ })
1516+ }
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