Skip to content

Commit

Permalink
verilog-language-server_test: Added register variable and gate symbol…
Browse files Browse the repository at this point in the history
…s test

Signed-off-by: Jan Bylicki <[email protected]>
  • Loading branch information
jbylicki committed Jun 16, 2023
1 parent 5ff1475 commit 28c1e5f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion verilog/tools/ls/verilog-language-server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ endpackage
module mini(input clk);
always@(posedge clk) begin : labelled_block
end
reg foo;
net bar;
some_class baz();
endmodule
)");

Expand Down Expand Up @@ -331,9 +336,18 @@ endmodule

// Descent tree into module and find labelled block.
std::vector<verible::lsp::DocumentSymbol> module = toplevel[1].children;
EXPECT_EQ(module.size(), 1);
EXPECT_EQ(module.size(), 4);
EXPECT_EQ(module[0].kind, verible::lsp::SymbolKind::kNamespace);
EXPECT_EQ(module[0].name, "labelled_block");

EXPECT_EQ(module[1].kind, verible::lsp::SymbolKind::kVariable);
EXPECT_EQ(module[1].name, "foo");

EXPECT_EQ(module[2].kind, verible::lsp::SymbolKind::kVariable);
EXPECT_EQ(module[2].name, "bar");

EXPECT_EQ(module[3].kind, verible::lsp::SymbolKind::kVariable);
EXPECT_EQ(module[3].name, "baz");
}

// Tests closing of the file in the LS context and checks if the LS
Expand Down

0 comments on commit 28c1e5f

Please sign in to comment.