@@ -95,15 +95,16 @@ func TestLibrariesLoader(t *testing.T) {
95
95
func TestSymlinkLoop (t * testing.T ) {
96
96
// Set up directory structure of test library.
97
97
testLib := paths .New ("testdata" , "TestLib" )
98
- examplesPath := testLib .Join ("examples" )
98
+ examplesPath , err := testLib .Join ("examples" ).Abs ()
99
+ require .NoError (t , err )
99
100
require .NoError (t , examplesPath .Mkdir ())
100
101
defer examplesPath .RemoveAll ()
101
102
102
103
// 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 ())
104
105
require .NoError (t , err , "This test must be run as administrator on Windows to have symlink creation privilege." )
105
106
// 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 ())
107
108
require .NoError (t , err )
108
109
109
110
// The failure condition is Load() never returning, testing for which requires setting up a timeout.
@@ -123,15 +124,16 @@ func TestSymlinkLoop(t *testing.T) {
123
124
func TestLegacySymlinkLoop (t * testing.T ) {
124
125
// Set up directory structure of test library.
125
126
testLib := paths .New ("testdata" , "LegacyLib" )
126
- examplesPath := testLib .Join ("examples" )
127
+ examplesPath , err := testLib .Join ("examples" ).Abs ()
128
+ require .NoError (t , err )
127
129
require .NoError (t , examplesPath .Mkdir ())
128
130
defer examplesPath .RemoveAll ()
129
131
130
132
// 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 ())
132
134
require .NoError (t , err , "This test must be run as administrator on Windows to have symlink creation privilege." )
133
135
// 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 ())
135
137
require .NoError (t , err )
136
138
137
139
// The failure condition is Load() never returning, testing for which requires setting up a timeout.
0 commit comments