@@ -63,8 +63,8 @@ func createTestSyncClient(testLocalPath, testRemotePath string) *SyncConfig {
6363}
6464
6565func TestInitialSync (t * testing.T ) {
66- if runtime .GOOS == "windows " {
67- t .Skip ("Skipping test on windows " )
66+ if runtime .GOOS != "linux " {
67+ t .Skip ("Skipping test on non linux platform " )
6868 }
6969
7070 remote , local , outside := initTestDirs (t )
@@ -116,13 +116,12 @@ func TestInitialSync(t *testing.T) {
116116 return
117117 }
118118
119- //This seems to hang in travis
120119 checkFilesAndFolders (t , filesToCheck , foldersToCheck , local , remote , 10 * time .Second )
121120}
122121
123122func TestNormalSync (t * testing.T ) {
124- if runtime .GOOS == "windows " {
125- t .Skip ("Skipping test on windows " )
123+ if runtime .GOOS != "linux " {
124+ t .Skip ("Skipping test on non linux systems " )
126125 }
127126
128127 remote , local , outside := initTestDirs (t )
@@ -187,16 +186,12 @@ func TestNormalSync(t *testing.T) {
187186 t .Error (err )
188187 return
189188 }
190- checkFilesAndFolders (t , filesToCheck , foldersToCheck , local , remote , 10 * time .Second )
191-
189+ checkFilesAndFolders (t , filesToCheck , foldersToCheck , local , remote , 20 * time .Second )
192190}
193191
194192func setExcludePaths (syncClient * SyncConfig , testCases testCaseList ) {
195-
196193 syncClient .ExcludePaths = []string {}
197-
198194 syncClient .DownloadExcludePaths = []string {}
199-
200195 syncClient .UploadExcludePaths = []string {}
201196
202197 for _ , testCase := range testCases {
@@ -298,7 +293,6 @@ func makeBasicTestCases() (testCaseList, testCaseList) {
298293}
299294
300295func makeRemoveAndRenameTestCases (filesToCheck testCaseList , foldersToCheck testCaseList ) (testCaseList , testCaseList ) {
301-
302296 for n , array := range [2 ]testCaseList {filesToCheck , foldersToCheck } {
303297 for _ , f := range array {
304298
@@ -406,13 +400,10 @@ func makeRemoveAndRenameTestCases(filesToCheck testCaseList, foldersToCheck test
406400 foldersToCheck = append (foldersToCheck , renameFolderFromOutside ... )
407401
408402 return filesToCheck , foldersToCheck
409-
410403}
411404
412405func makeRemoteTestCases (testCases testCaseList ) testCaseList {
413-
414406 for _ , f := range testCases {
415-
416407 if strings .Contains (f .path , "Upload" ) {
417408 f .path = strings .Replace (f .path , "Upload" , "Download" , - 1 )
418409 } else if strings .Contains (f .path , "Download" ) {
@@ -432,9 +423,7 @@ func makeRemoteTestCases(testCases testCaseList) testCaseList {
432423}
433424
434425func makeDeepTestCases (testCases testCaseList ) testCaseList {
435-
436426 for _ , f := range testCases {
437-
438427 if f .path == "testFolder" {
439428 continue
440429 }
@@ -452,7 +441,6 @@ func makeDeepTestCases(testCases testCaseList) testCaseList {
452441}
453442
454443func createTestFilesAndFolders (local string , remote string , outside string , filesToCheck testCaseList , foldersToCheck testCaseList ) error {
455-
456444 for _ , f := range foldersToCheck {
457445 parentDir , err := getParentDir (local , remote , outside , f .editLocation )
458446 if err != nil {
@@ -482,7 +470,6 @@ func createTestFilesAndFolders(local string, remote string, outside string, file
482470}
483471
484472func removeSomeTestFilesAndFolders (local string , remote string , filesToCheck testCaseList , foldersToCheck testCaseList , removeSuffix string ) (testCaseList , testCaseList , error ) {
485-
486473 var completeSuffix string
487474 removeIfSuffixMatch := func (path string , f os.FileInfo , err error ) error {
488475 if strings .HasSuffix (path , completeSuffix ) {
@@ -520,11 +507,8 @@ func removeSomeTestFilesAndFolders(local string, remote string, filesToCheck tes
520507}
521508
522509func renameSomeTestFilesAndFolders (local string , remote string , outside string , filesToCheck testCaseList , foldersToCheck testCaseList ) (testCaseList , testCaseList , error ) {
523-
524510 for n , array := range [2 ]testCaseList {filesToCheck , foldersToCheck } {
525-
526511 for n , f := range array {
527-
528512 if ! strings .Contains (f .path , "_Rename" ) {
529513 continue
530514 }
@@ -572,7 +556,6 @@ func renameSomeTestFilesAndFolders(local string, remote string, outside string,
572556 }
573557
574558 array [n ] = f
575-
576559 }
577560
578561 if n == 0 {
0 commit comments