mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 18:36:55 +00:00
[clangd] Fix windows buildbots
This commit is contained in:
parent
252c4dce61
commit
60adfb83cd
@ -1514,26 +1514,6 @@ TEST(Hover, All) {
|
||||
HI.Name = "cls<cls<cls<int> > >";
|
||||
HI.Documentation = "type of nested templates.";
|
||||
}},
|
||||
{
|
||||
R"cpp(// sizeof expr
|
||||
void foo() {
|
||||
(void)[[size^of]](char);
|
||||
})cpp",
|
||||
[](HoverInfo &HI) {
|
||||
HI.Name = "expression";
|
||||
HI.Type = "unsigned long";
|
||||
HI.Value = "1";
|
||||
}},
|
||||
{
|
||||
R"cpp(// alignof expr
|
||||
void foo() {
|
||||
(void)[[align^of]](char);
|
||||
})cpp",
|
||||
[](HoverInfo &HI) {
|
||||
HI.Name = "expression";
|
||||
HI.Type = "unsigned long";
|
||||
HI.Value = "1";
|
||||
}},
|
||||
};
|
||||
|
||||
// Create a tiny index, so tests above can verify documentation is fetched.
|
||||
@ -1794,6 +1774,49 @@ Value = val
|
||||
|
||||
def)pt");
|
||||
}
|
||||
|
||||
TEST(Hover, ExprTests) {
|
||||
struct {
|
||||
const char *const Code;
|
||||
const std::function<void(HoverInfo &)> ExpectedBuilder;
|
||||
} Cases[] = {
|
||||
{
|
||||
R"cpp(// sizeof expr
|
||||
void foo() {
|
||||
(void)[[size^of]](char);
|
||||
})cpp",
|
||||
[](HoverInfo &HI) {
|
||||
HI.Name = "expression";
|
||||
HI.Type = "unsigned long";
|
||||
HI.Value = "1";
|
||||
}},
|
||||
{
|
||||
R"cpp(// alignof expr
|
||||
void foo() {
|
||||
(void)[[align^of]](char);
|
||||
})cpp",
|
||||
[](HoverInfo &HI) {
|
||||
HI.Name = "expression";
|
||||
HI.Type = "unsigned long";
|
||||
HI.Value = "1";
|
||||
}},
|
||||
};
|
||||
for (const auto &C : Cases) {
|
||||
Annotations T(C.Code);
|
||||
TestTU TU = TestTU::withCode(T.code());
|
||||
auto AST = TU.build();
|
||||
for (const auto &D : AST.getDiagnostics())
|
||||
ADD_FAILURE() << D;
|
||||
|
||||
auto H = getHover(AST, T.point(), format::getLLVMStyle(), nullptr);
|
||||
ASSERT_TRUE(H);
|
||||
HoverInfo ExpectedHover;
|
||||
C.ExpectedBuilder(ExpectedHover);
|
||||
// We don't check for Type as it might differ on different platforms.
|
||||
EXPECT_EQ(H->Name, ExpectedHover.Name);
|
||||
EXPECT_EQ(H->Value, ExpectedHover.Value);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
} // namespace clangd
|
||||
} // namespace clang
|
||||
|
Loading…
x
Reference in New Issue
Block a user