Class EmptyTestDetector
java.lang.Object
org.ek9lang.compiler.phase5.callgraph.EmptyTestDetector
Detects @Test programs that have no validation - neither assertions nor expected output files.
E81007: Empty @Test program (no assertions and no expected output files)
A @Test is considered valid if it has EITHER:
- Assertions reachable in its transitive call graph
- Expected output files (expected_output.txt or expected_case_*.txt)
Tests with neither validation mechanism provide false confidence and are flagged as errors.
-
Constructor Summary
ConstructorsConstructorDescriptionEmptyTestDetector(CallGraph callGraph, CallableErrorListenerLookup errorListenerLookup) Create a detector for empty @Test programs. -
Method Summary
Modifier and TypeMethodDescriptionvoiddetect(Consumer<CallableInfo> consumer) Alternative API for just detection without error emission.Detect all empty @Test programs and emit E81007 errors.
-
Constructor Details
-
EmptyTestDetector
Create a detector for empty @Test programs.- Parameters:
callGraph- The call graph with test entry points and assertion informationerrorListenerLookup- Function to get ErrorListener for emitting errors
-
-
Method Details
-
detectAndReport
-
detect
Alternative API for just detection without error emission. Useful for testing and analysis.- Parameters:
consumer- Callback for each empty test found
-