[PATCH] D60873: [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path
Matthew Voss via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 18 13:21:24 PDT 2019
ormris added inline comments.
Comment at: clang-tools-extra/unittests/clangd/HeadersTests.cpp:220
+ BarHeader = testPath("sub/bar.h");
+ EXPECT_EQ(calculate(BarHeader), "\"sub/bar.h\"");
> ormris wrote:
> > Quick nit: This test won't work on Windows as it only tests for POSIX-style path separators. You could easily add a Windows ifdef, though.
> testPath() returns an appropriate native path, and calculate() returns an #include string (which always uses /).
> The "../" on line 217 looks a little more suspicious, but I think the clang driver might silently Do What I Mean here.
> Are you seeing test failures?
Yes, here's the output.
[ RUN ] HeadersTest.ShortenedInclude
C:\llvm\tools\clang\tools\extra\unittests\clangd\HeadersTests.cpp(220): error: Expected: calculate(BarHeader)
Which is: "\"sub\\bar.h\""
To be equal to: "\"sub/bar.h\""
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits