[PATCH] D27527: Process tilde in llvm::sys::path::native.

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 21:23:56 PST 2017


sepavloff added inline comments.


================
Comment at: unittests/Support/Path.cpp:951-953
+  EXPECT_TRUE(Path7.endswith("\\aaa"));
+  EXPECT_TRUE(Path7.startswith(PathHome));
+  EXPECT_EQ(Path7.size(), PathHome.size() + strlen(Path7a + 1));
----------------
rnk wrote:
> Does this simplify to `EXPECT_EQ(Path7, PathHome + "\\aaa")`? If so we don't need the const char * local.
`SmallString` does not have `operator +`. It has `operator +=` but it does not help here. 


================
Comment at: unittests/Support/Path.cpp:958
+  path::native(Path8);
+  EXPECT_TRUE(Path8.equals(PathHome));
+
----------------
rnk wrote:
> Does EXPECT_EQ work?
Yes, it works, as SmallString has `operator ==` inherited from `SmallVectorImpl`.
It also works in comparisons with string literals, due to presence of:
- `operator==(StringRef, StringRef)`
- `SmallString::operator StringRef()`
- `StringRef(const char *)`
Corresponding checks were updated accordingly.


https://reviews.llvm.org/D27527





More information about the llvm-commits mailing list