Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Adjust filesystem unit tests to correspond to final TS #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/filesystem/unit_tests/dynamic_test_helper.hpp
Original file line number Diff line number Diff line change
@@ -33,7 +33,10 @@ inline elib::fs::path test_env_path()

inline elib::fs::path random_env_path()
{
return test_env_path() / elib::fs::unique_path();
char* s = tempnam(".", "test.");
elib::fs::path p(s);
std::free(s);
return test_env_path() / p.filename();
}

inline void python_run(const std::string& cmd)
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@ TEST_SUITE(elib_filesystem_static_directory_entry_test_suite)

TEST_CASE(symlink_status_test)
{
directory_entry d(".", file_status(), file_status(file_type::regular));
TEST_CHECK(d.status().type() == file_type::regular);
TEST_CHECK(d.symlink_status().type() == file_type::regular);
directory_entry d(".");
TEST_CHECK(d.status().type() == file_type::directory);
TEST_CHECK(d.symlink_status().type() == file_type::directory);
}


6 changes: 6 additions & 0 deletions src/filesystem/unit_tests/static_tests/path_test.pass.cpp
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@ TEST_CASE(assign_test)
p.assign(expect);
TEST_CHECK(p == expect);
}
#if 0
// assign source type test
{
std::string expect("my_path");
@@ -94,6 +95,7 @@ TEST_CASE(assign_test)
p = source;
TEST_CHECK(p == expect);
}
#endif
// assign iterator
{
std::string expect("my_path");
@@ -185,13 +187,15 @@ TEST_CASE(concat_test)
p1 += s2.c_str();
TEST_CHECK(p1 == expect);
}
#if 0
// concat source type
{
path p1(s1);
std::vector<char> p2(s2.begin(), s2.end());
p1 += p2;
TEST_CHECK(p1 == expect);
}
#endif
// concat char
{
path p1(s1);
@@ -204,6 +208,7 @@ TEST_CASE(concat_test)
p += L'p';
TEST_CHECK(p == path("p1/p"));
}
#if 0
// concat source member type
{
path p1(s1);
@@ -218,6 +223,7 @@ TEST_CASE(concat_test)
p1.concat(p2.begin(), p2.end());
TEST_CHECK(p1 == expect);
}
#endif
}

TEST_CASE(clear_test)
49 changes: 0 additions & 49 deletions src/filesystem/unit_tests/static_tests/unique_path_test.pass.cpp

This file was deleted.