@@ -95,15 +95,16 @@ func TestLibrariesLoader(t *testing.T) {
9595func TestSymlinkLoop (t * testing.T ) {
9696 // Set up directory structure of test library.
9797 testLib := paths .New ("testdata" , "TestLib" )
98- examplesPath := testLib .Join ("examples" )
98+ examplesPath , err := testLib .Join ("examples" ).Abs ()
99+ require .NoError (t , err )
99100 require .NoError (t , examplesPath .Mkdir ())
100101 defer examplesPath .RemoveAll ()
101102
102103 // It's probably most friendly for contributors using Windows to create the symlinks needed for the test on demand.
103- err : = os .Symlink (examplesPath . Join ( ".." ) .String (), examplesPath .Join ("UpGoer1" ).String ())
104+ err = os .Symlink (examplesPath .String (), examplesPath .Join ("UpGoer1" ).String ())
104105 require .NoError (t , err , "This test must be run as administrator on Windows to have symlink creation privilege." )
105106 // It's necessary to have multiple symlinks to a parent directory to create the loop.
106- err = os .Symlink (examplesPath .Join ( ".." ). String (), examplesPath .Join ("UpGoer2" ).String ())
107+ err = os .Symlink (examplesPath .String (), examplesPath .Join ("UpGoer2" ).String ())
107108 require .NoError (t , err )
108109
109110 // The failure condition is Load() never returning, testing for which requires setting up a timeout.
@@ -123,15 +124,16 @@ func TestSymlinkLoop(t *testing.T) {
123124func TestLegacySymlinkLoop (t * testing.T ) {
124125 // Set up directory structure of test library.
125126 testLib := paths .New ("testdata" , "LegacyLib" )
126- examplesPath := testLib .Join ("examples" )
127+ examplesPath , err := testLib .Join ("examples" ).Abs ()
128+ require .NoError (t , err )
127129 require .NoError (t , examplesPath .Mkdir ())
128130 defer examplesPath .RemoveAll ()
129131
130132 // It's probably most friendly for contributors using Windows to create the symlinks needed for the test on demand.
131- err : = os .Symlink (examplesPath . Join ( ".." ) .String (), examplesPath .Join ("UpGoer1" ).String ())
133+ err = os .Symlink (examplesPath .String (), examplesPath .Join ("UpGoer1" ).String ())
132134 require .NoError (t , err , "This test must be run as administrator on Windows to have symlink creation privilege." )
133135 // It's necessary to have multiple symlinks to a parent directory to create the loop.
134- err = os .Symlink (examplesPath .Join ( ".." ). String (), examplesPath .Join ("UpGoer2" ).String ())
136+ err = os .Symlink (examplesPath .String (), examplesPath .Join ("UpGoer2" ).String ())
135137 require .NoError (t , err )
136138
137139 // The failure condition is Load() never returning, testing for which requires setting up a timeout.
0 commit comments