Commit 30028461 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque-ls] fix Windows file paths

Bug: v8:8880
Change-Id: I8693def4aea26a5a9430f4c49d701fae14b2f27b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578502Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60963}
parent bca4c8b9
......@@ -73,7 +73,11 @@ std::string StringLiteralQuote(const std::string& s) {
return result.str();
}
#ifdef V8_OS_WIN
static const char kFileUriPrefix[] = "file:///";
#else
static const char kFileUriPrefix[] = "file://";
#endif
static const int kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1;
static int HexCharToInt(unsigned char c) {
......
......@@ -17,12 +17,15 @@ TEST(TorqueUtils, FileUriDecodeIllegal) {
}
TEST(TorqueUtils, FileUriDecode) {
EXPECT_EQ(FileUriDecode("file:///some/src/file.tq").value(),
"/some/src/file.tq");
#ifdef V8_OS_WIN
EXPECT_EQ(FileUriDecode("file:///c%3A/torque/base.tq").value(),
"/c:/torque/base.tq");
"c:/torque/base.tq");
EXPECT_EQ(FileUriDecode("file:///d%3a/lower/hex.txt").value(),
"/d:/lower/hex.txt");
"d:/lower/hex.txt");
#else
EXPECT_EQ(FileUriDecode("file:///some/src/file.tq").value(),
"/some/src/file.tq");
#endif
}
} // namespace torque
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment