| 169 | } |
| 170 | |
| 171 | TEST(InterPlanetaryFileSystemTest, IPFSMatch) { |
| 172 | InterPlanetaryFileSystem ipfs; |
| 173 | EXPECT_EQ(Match(&ipfs, "thereisnosuchfile"), ""); |
| 174 | EXPECT_EQ(Match(&ipfs, "*"), |
| 175 | "Earth,Jupiter,Mars,Mercury,Neptune,Saturn,Uranus,Venus"); |
| 176 | // Returns Jupiter's moons. |
| 177 | EXPECT_EQ(Match(&ipfs, "Jupiter/*"), |
| 178 | "Jupiter/Europa,Jupiter/Ganymede,Jupiter/Io"); |
| 179 | // Returns Jupiter's and Earth's moons. |
| 180 | EXPECT_EQ(Match(&ipfs, "*/*"), |
| 181 | "Earth/Moon,Jupiter/Europa,Jupiter/Ganymede,Jupiter/Io"); |
| 182 | TF_EXPECT_OK(ipfs.CreateDir(io::JoinPath(kPrefix, "Planet0"))); |
| 183 | TF_EXPECT_OK(ipfs.CreateDir(io::JoinPath(kPrefix, "Planet1"))); |
| 184 | EXPECT_EQ(Match(&ipfs, "Planet[0-1]"), "Planet0,Planet1"); |
| 185 | EXPECT_EQ(Match(&ipfs, "Planet?"), "Planet0,Planet1"); |
| 186 | } |
| 187 | |
| 188 | TEST(InterPlanetaryFileSystemTest, MatchSimple) { |
| 189 | InterPlanetaryFileSystem ipfs; |
nothing calls this directly
no test coverage detected