mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-07-20 16:44:27 +08:00
Additional tests.
This commit is contained in:
parent
af4bbe14e1
commit
3ae76b29a0
@ -2515,6 +2515,7 @@ GHC_INLINE path::iterator::iterator(const path::string_type::const_iterator& fir
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (_first != _last && *_first == '/') {
|
||||
if (_last - _first >= 2 && *(_first + 1) == '/' && !(_last - _first >= 3 && *(_first + 2) == '/')) {
|
||||
_root = increment(_first);
|
||||
@ -2526,6 +2527,7 @@ GHC_INLINE path::iterator::iterator(const path::string_type::const_iterator& fir
|
||||
else {
|
||||
_root = _last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GHC_INLINE path::string_type::const_iterator path::iterator::increment(const path::string_type::const_iterator& pos) const
|
||||
@ -2631,7 +2633,7 @@ GHC_INLINE path::iterator& path::iterator::operator--()
|
||||
|
||||
GHC_INLINE path::iterator path::iterator::operator--(int)
|
||||
{
|
||||
path::iterator i{*this};
|
||||
auto i = *this;
|
||||
--(*this);
|
||||
return i;
|
||||
}
|
||||
|
@ -968,13 +968,19 @@ TEST_CASE("30.10.8.5 path iterators", "[filesystem][path][fs.path.itr]")
|
||||
p2 /= pe;
|
||||
}
|
||||
CHECK(p1 == p2);
|
||||
CHECK("bar" == *(--fs::path("/foo/bar").end()));
|
||||
auto p = fs::path("/foo/bar");
|
||||
auto pi = p.end();
|
||||
pi--;
|
||||
CHECK("bar" == *pi);
|
||||
}
|
||||
|
||||
if (has_host_root_name_support()) {
|
||||
CHECK("foo" == *(--fs::path("//host/foo").end()));
|
||||
/*auto pi = fs::path("//host/foo").end();
|
||||
auto p = fs::path("//host/foo");
|
||||
auto pi = p.end();
|
||||
pi--;
|
||||
CHECK("foo" == *pi);*/
|
||||
CHECK("foo" == *pi);
|
||||
CHECK("//host" == iterateResult(fs::path("//host")));
|
||||
CHECK("//host,/,foo" == iterateResult(fs::path("//host/foo")));
|
||||
CHECK("//host" == reverseIterateResult(fs::path("//host")));
|
||||
|
Loading…
x
Reference in New Issue
Block a user