@@ -105,14 +105,28 @@ func TestLibraryHasSubmodule(t *testing.T) {
105105
106106func TestLibraryContainsSymlinks (t * testing.T ) {
107107 testLibrary := "Recursive"
108+ // Set up a library with a file target symlink.
108109 symlinkPath := librariesTestDataPath .Join (testLibrary , "test-symlink" )
109110 // It's probably most friendly to developers using Windows to create the symlink needed for the test on demand.
110111 err := os .Symlink (librariesTestDataPath .Join (testLibrary , "library.properties" ).String (), symlinkPath .String ())
111112 require .Nil (t , err , "This test must be run as administrator on Windows to have symlink creation privilege." )
112113 defer symlinkPath .RemoveAll () // clean up
113114
114115 testTables := []libraryRuleFunctionTestTable {
115- {"Has symlink" , testLibrary , ruleresult .Fail , "" },
116+ {"Has file target symlink" , testLibrary , ruleresult .Fail , "" },
117+ }
118+
119+ checkLibraryRuleFunction (LibraryContainsSymlinks , testTables , t )
120+
121+ err = symlinkPath .RemoveAll ()
122+ require .Nil (t , err )
123+
124+ // Set up a library with a folder target symlink.
125+ err = os .Symlink (librariesTestDataPath .Join (testLibrary , "src" ).String (), symlinkPath .String ())
126+ require .Nil (t , err )
127+
128+ testTables = []libraryRuleFunctionTestTable {
129+ {"Has folder target symlink" , testLibrary , ruleresult .Fail , "" },
116130 }
117131
118132 checkLibraryRuleFunction (LibraryContainsSymlinks , testTables , t )
0 commit comments