@@ -76,6 +76,21 @@ TEST_F(Filesystem, prefPath) {
76
76
EXPECT_THAT (fs.prefPath (), HasPartialPath (AppName));
77
77
}
78
78
79
+ TEST_F (Filesystem, findInParentsExist) {
80
+ // Try to find the unit test project folder
81
+ const auto folder = " test/" ;
82
+ EXPECT_THAT (fs.findInParents (folder, fs.basePath ()), testing::EndsWith (folder));
83
+ EXPECT_THAT (fs.findInParents (folder, fs.basePath (), 4 ), testing::EndsWith (folder));
84
+ }
85
+
86
+ TEST_F (Filesystem, findInParentsNotExist) {
87
+ EXPECT_EQ (" " , fs.findInParents (" FolderThatDoesNotExist/" , fs.basePath (), 0 ));
88
+ EXPECT_EQ (" " , fs.findInParents (" FolderThatDoesNotExist/" , fs.basePath (), 1 ));
89
+ EXPECT_EQ (" " , fs.findInParents (" FolderThatDoesNotExist/" , fs.basePath (), 2 ));
90
+ EXPECT_EQ (" " , fs.findInParents (" FolderThatDoesNotExist/" , fs.basePath (), 3 ));
91
+ EXPECT_EQ (" " , fs.findInParents (" FolderThatDoesNotExist/" , fs.basePath (), 4 ));
92
+ }
93
+
79
94
TEST_F (Filesystem, searchPath) {
80
95
auto pathList = fs.searchPath ();
81
96
EXPECT_EQ (3u , pathList.size ());
0 commit comments