TestSourceScanner
classin packageklyn.unittest
public final class TestSourceScanner:
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.

Example
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]
Methods
Modifier and Type Member Description
public static declaresTestClass
declaresTestClass(source as String) as Boolean:
Reports whether source contains an effective @TestClass annotation.
public static testLines
testLines(source as String) as ArrayList<Int>:
Returns zero-based lines carrying @TestClass or @Test.