mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Adds llvm::sys::path::is_separator() to test whether a char is a path separator
on the host OS. Reviewed by dgregor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -29,6 +29,19 @@ using namespace llvm::sys;
|
||||
|
||||
namespace {
|
||||
|
||||
TEST(is_separator, Works) {
|
||||
EXPECT_TRUE(path::is_separator('/'));
|
||||
EXPECT_FALSE(path::is_separator('\0'));
|
||||
EXPECT_FALSE(path::is_separator('-'));
|
||||
EXPECT_FALSE(path::is_separator(' '));
|
||||
|
||||
#ifdef LLVM_ON_WIN32
|
||||
EXPECT_TRUE(path::is_separator('\\'));
|
||||
#else
|
||||
EXPECT_FALSE(path::is_separator('\\'));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(Support, Path) {
|
||||
SmallVector<StringRef, 40> paths;
|
||||
paths.push_back("");
|
||||
|
Reference in New Issue
Block a user