File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -429,3 +429,19 @@ func TestFindProjects(t *testing.T) {
429
429
}
430
430
}
431
431
}
432
+
433
+ func TestExamplefile (t * testing.T ) {
434
+ // Set up directory structure of test library.
435
+ libraryPath , err := paths .TempDir ().MkTempDir ("TestExampleFile" )
436
+ defer libraryPath .RemoveAll () // Clean up after the test.
437
+ require .Nil (t , err )
438
+ err = libraryPath .Join ("TestExample.h" ).WriteFile ([]byte {})
439
+ require .Nil (t , err )
440
+ // Create an example file in the library folder. This should not cause a panic and should be ignored since it's not a folder containing the examples
441
+ err = libraryPath .Join ("example" ).WriteFile ([]byte {})
442
+ require .Nil (t , err )
443
+
444
+ configuration .Initialize (test .ConfigurationFlags (), []string {libraryPath .String ()})
445
+
446
+ assert .NotPanics (t , func () { FindProjects () }, "Example file should not cause panic" )
447
+ }
You can’t perform that action at this time.
0 commit comments