stream: add file::exists and file::readonly
We are targeting C++14, while C++17 already has std::filesystem::exists. 😢 Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
SPDX-License-Identifier: MIT
|
||||
Copyright © 2023 Amebis
|
||||
*/
|
||||
@@ -26,6 +26,7 @@ int main(int argc, const char * argv[])
|
||||
UnitTests::stream::async();
|
||||
UnitTests::stream::replicator();
|
||||
UnitTests::stream::open_close();
|
||||
UnitTests::stream::file_stat();
|
||||
UnitTests::unicode::str2wstr();
|
||||
UnitTests::unicode::wstr2str();
|
||||
UnitTests::unicode::charset_encoder();
|
||||
|
@@ -139,6 +139,13 @@ namespace UnitTests
|
||||
std::filesystem::remove(filename[i]);
|
||||
}
|
||||
|
||||
TEST_METHOD(file_stat)
|
||||
{
|
||||
sstring path(temp_path());
|
||||
Assert::IsTrue(stdex::stream::file::exists(path));
|
||||
Assert::IsFalse(stdex::stream::file::readonly(path));
|
||||
}
|
||||
|
||||
protected:
|
||||
static sstring temp_path()
|
||||
{
|
||||
|
Reference in New Issue
Block a user