public final class TestSourceScanner:
Performs a lightweight lexical scan of Klyn test sources.
The scanner recognizes test annotations while ignoring comments, character and code-unit literals, and strings, including raw, formatted and triple-quoted strings. Compilation remains authoritative for validating the complete source.
import klyn.unittest source = "@TestClass\nclass SampleTest:\n @Test\n public check():\n pass\n" assert TestSourceScanner.declaresTestClass(source) assert TestSourceScanner.testLines(source) == [0, 2]
| Modifier and Type | Member | Description |
|---|---|---|
| public static | declaresTestClass | Reports whether source contains an effective @TestClass annotation. |
| public static | testLines | Returns zero-based lines carrying @TestClass or @Test. |