diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-16 01:01:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-16 01:46:05 +0300 |
commit | 24bd6a6d26bab89126db7183bb693779a1742c6d (patch) | |
tree | 1a7ae594883562a01abdb2c8070a6585af2780e4 /src/fs/virtfs/virtfs_unittest.cc | |
parent | 65ef43ab06f3dfb7b87caa3ba8236ea741d59f35 (diff) | |
download | plus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.gz plus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.bz2 plus-24bd6a6d26bab89126db7183bb693779a1742c6d.tar.xz plus-24bd6a6d26bab89126db7183bb693779a1742c6d.zip |
Add subdir support into virtfs::exists.
Diffstat (limited to 'src/fs/virtfs/virtfs_unittest.cc')
-rw-r--r-- | src/fs/virtfs/virtfs_unittest.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/fs/virtfs/virtfs_unittest.cc b/src/fs/virtfs/virtfs_unittest.cc index 8c7688cb6..3718fddda 100644 --- a/src/fs/virtfs/virtfs_unittest.cc +++ b/src/fs/virtfs/virtfs_unittest.cc @@ -190,6 +190,37 @@ TEST_CASE("VirtFs exists5") delete2(logger); } +TEST_CASE("VirtFs exists6") +{ + logger = new Logger(); + std::string name("data/test/test.zip"); + std::string prefix; + if (Files::existsLocal(name) == false) + prefix = "../" + prefix; + + VirtFs::mountZip2(prefix + "data/test/test2.zip", + "dir", + Append_false); + + REQUIRE(VirtFs::exists("test") == false); + REQUIRE(VirtFs::exists("test/units.xml") == false); + REQUIRE(VirtFs::exists("test.txt") == false); + REQUIRE(VirtFs::exists("dir/hide.png") == false); + REQUIRE(VirtFs::exists("dir/gpl") == false); + REQUIRE(VirtFs::exists("dir/gpl/zzz") == false); + REQUIRE(VirtFs::exists("units.xml") == false); + REQUIRE(VirtFs::exists("units.xml.") == false); + REQUIRE(VirtFs::exists("units.xml2") == false); + REQUIRE(VirtFs::exists("hide.png")); + REQUIRE(VirtFs::exists("dye.png")); + REQUIRE(VirtFs::exists("gpl")); + REQUIRE(VirtFs::exists("gpl/zzz") == false); + + VirtFs::unmountZip2(prefix + "data/test/test2.zip", + "dir"); + delete2(logger); +} + static void removeTemp(StringVect &restrict list) { int cnt = 0; |