[libcxx-commits] [PATCH] D89943: [libcxx] [test] Fix path.decompose for windows
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 25 04:22:14 PST 2021
mstorsjo added inline comments.
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp:184
+ std::replace(root_name.begin(), root_name.end(), '\\', '/');
+ if (root_name == '/' && root_name == '/')
+ assert(p.is_absolute() == true);
> root_name here can possibly have less than 2 characters. You should probably assert that if it's non-empty, then it should have size() >= 2.
Good point, will do that.
Technically, we're not facing unknown inputs here, we only ever get things based on inputs in the table above (and whatever a more or less broken implementation returns based on it), but it's certainly good to verify this in any case.
CHANGES SINCE LAST ACTION
More information about the libcxx-commits