Files
wehub-resource-sync c6af9e284a
Tests / catch-all (windows-latest) (push) Has been cancelled
Tests / jvm (macos-latest) (push) Has been cancelled
Tests / jvm (ubuntu-latest) (push) Has been cancelled
Tests / jvm (windows-latest) (push) Has been cancelled
Tests / native (macos-latest) (push) Has been cancelled
Tests / native (ubuntu-latest) (push) Has been cancelled
Tests / native (windows-latest) (push) Has been cancelled
Tests / niche (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (macos-latest) (push) Has been cancelled
Tests / other-langs (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (windows-latest) (push) Has been cancelled
Tests / catch-all (macos-latest) (push) Has been cancelled
Tests / catch-all (ubuntu-latest) (push) Has been cancelled
Docs Build / build (push) Has been cancelled
Docs Build / deploy (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Build and Push Docker Images / build-and-push (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:38 +08:00

25 lines
851 B
Python

import os
import pytest
from solidlsp.ls_config import Language
from test.conftest import start_ls_context
@pytest.mark.cpp
class TestCCLSLanguages:
@pytest.mark.parametrize(
"lang, unit, names",
[
("C", "a.c", {"main"}),
("Objective-C", "a.m", {"main", "Hello", "-hello"}),
],
)
def test_get_document_symbols(self, lang: str, unit: str, names: set[str]) -> None:
with start_ls_context(Language.CPP) as ccls:
path = os.path.join(lang, unit)
symbols = ccls.request_document_symbols(path).get_all_symbols_and_roots()
symbols = symbols[0] if symbols and isinstance(symbols[0], list) else symbols
symbols = {s.get("name") for s in symbols}
assert names == symbols, f"Expected '{names}' in document symbols, got: {symbols}"