Updated readme, more tests, some typos in comments.

This commit is contained in:
Steffen Schuemann 2019-05-11 15:33:08 +02:00
parent 9ea5a8773b
commit 7e975a8f7f
3 changed files with 23 additions and 3 deletions

View File

@ -1,7 +1,7 @@
![Supported Platforms](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue.svg)
[![Build Status](https://travis-ci.org/gulrak/filesystem.svg?branch=master)](https://travis-ci.org/gulrak/filesystem)
[![Build status](https://ci.appveyor.com/api/projects/status/t07wp3k2cddo0hpo/branch/master?svg=true)](https://ci.appveyor.com/project/gulrak/filesystem)
![Latest Release Tag](https://img.shields.io/github/tag/gulrak/filesystem.svg)
[![Latest Release Tag](https://img.shields.io/github/tag/gulrak/filesystem.svg)](https://github.com/gulrak/filesystem/tree/v1.1.4)
# Filesystem
@ -97,6 +97,11 @@ in the standard, and there might be issues in these implementations too.
## Usage
### Downloads
The latest release version is [v1.1.4](https://github.com/gulrak/filesystem/tree/v1.1.4) and
source archives can be found [here](https://github.com/gulrak/filesystem/releases/tag/v1.1.4).
### Using it as Single-File-Header
As `ghc::filesystem` is at first a header-only library, it should be enough to copy the header

View File

@ -33,7 +33,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//---------------------------------------------------------------------------------------
// fs_std.hpp - The dynamic switching header for that includes std::filesystem if detected
// fs_std.hpp - The dynamic switching header that includes std::filesystem if detected
// or ghc::filesystem if not, and makes the resulting API available in the
// namespace fs.
//---------------------------------------------------------------------------------------

View File

@ -295,7 +295,7 @@ bool operator!=(TestAllocator<T> const& x, TestAllocator<U> const& y) noexcept
return !(x == y);
}
TEST_CASE("Temporary Directory", "[temp dir]")
TEST_CASE("Temporary Directory", "[fs.test.tempdir]")
{
fs::path tempPath;
{
@ -307,6 +307,21 @@ TEST_CASE("Temporary Directory", "[temp dir]")
REQUIRE(!fs::exists(tempPath));
}
#ifdef GHC_FILESYSTEM_VERSION
TEST_CASE("fs::detail::fromUf88", "[filesystem][fs.detail.utf8]")
{
CHECK(fs::detail::fromUtf8<std::wstring>("foobar").length() == 6);
CHECK(fs::detail::fromUtf8<std::wstring>("foobar") == L"foobar");
CHECK(fs::detail::fromUtf8<std::wstring>(u8"föobar").length() == 6);
CHECK(fs::detail::fromUtf8<std::wstring>(u8"föobar") == L"föobar");
CHECK(fs::detail::toUtf8(std::wstring(L"foobar")).length() == 6);
CHECK(fs::detail::toUtf8(std::wstring(L"foobar")) == "foobar");
CHECK(fs::detail::toUtf8(std::wstring(L"föobar")).length() == 7);
CHECK(fs::detail::toUtf8(std::wstring(L"föobar")) == u8"föobar");
}
#endif
#ifndef GHC_OS_WINDOWS
TEST_CASE("30.10.8.1 path(\"//host\").has_root_name()", "[filesystem][path][fs.path.generic]")
{