This revision was automatically updated to reflect the committed changes. Closed by commit rL324475: [clangd] Do not precent-encode numbers in URI. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits.
Repository: rL LLVM https://reviews.llvm.org/D43009 Files: clang-tools-extra/trunk/clangd/URI.cpp clang-tools-extra/trunk/unittests/clangd/URITests.cpp Index: clang-tools-extra/trunk/unittests/clangd/URITests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/URITests.cpp +++ clang-tools-extra/trunk/unittests/clangd/URITests.cpp @@ -72,6 +72,7 @@ TEST(PercentEncodingTest, Encode) { EXPECT_EQ(URI("x", /*Authority=*/"", "a/b/c").toString(), "x:a/b/c"); EXPECT_EQ(URI("x", /*Authority=*/"", "a!b;c~").toString(), "x:a%21b%3bc~"); + EXPECT_EQ(URI("x", /*Authority=*/"", "a123b").toString(), "x:a123b"); } TEST(PercentEncodingTest, Decode) { Index: clang-tools-extra/trunk/clangd/URI.cpp =================================================================== --- clang-tools-extra/trunk/clangd/URI.cpp +++ clang-tools-extra/trunk/clangd/URI.cpp @@ -79,7 +79,8 @@ bool shouldEscape(unsigned char C) { // Unreserved characters. - if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z')) + if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') || + (C >= '0' && C <= '9')) return false; switch (C) { case '-':
Index: clang-tools-extra/trunk/unittests/clangd/URITests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/URITests.cpp +++ clang-tools-extra/trunk/unittests/clangd/URITests.cpp @@ -72,6 +72,7 @@ TEST(PercentEncodingTest, Encode) { EXPECT_EQ(URI("x", /*Authority=*/"", "a/b/c").toString(), "x:a/b/c"); EXPECT_EQ(URI("x", /*Authority=*/"", "a!b;c~").toString(), "x:a%21b%3bc~"); + EXPECT_EQ(URI("x", /*Authority=*/"", "a123b").toString(), "x:a123b"); } TEST(PercentEncodingTest, Decode) { Index: clang-tools-extra/trunk/clangd/URI.cpp =================================================================== --- clang-tools-extra/trunk/clangd/URI.cpp +++ clang-tools-extra/trunk/clangd/URI.cpp @@ -79,7 +79,8 @@ bool shouldEscape(unsigned char C) { // Unreserved characters. - if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z')) + if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') || + (C >= '0' && C <= '9')) return false; switch (C) { case '-':
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits