Class PlaceholderMatcher
java.lang.Object
org.ek9lang.cli.PlaceholderMatcher
Matches expected output containing {{Type}} placeholders against actual output.
Placeholders use EK9 type names - if you know EK9 types, you know the placeholders.
Supports 18 placeholder types corresponding to EK9 built-in types:
- Basic: String, Integer, Float, Boolean, Character, Bits
- Date/Time: Date, Time, DateTime, Duration, Millisecond
- Measurement: Money, Colour, Resolution, Dimension
- Pattern: RegEx, GUID
- File system: FileSystemPath
Example usage in expected_output.txt:
Completed in: {{Millisecond}}
Timestamp: {{DateTime}}
Cost: {{Money}}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet list of all supported placeholder type names.(package private) booleanhasPlaceholders(String expected) Check if expected output contains any placeholders.(package private) booleanMatch expected output (with placeholders) against actual output.validatePlaceholders(String expected) Validate that all placeholders in expected output are valid EK9 types.
-
Constructor Details
-
PlaceholderMatcher
PlaceholderMatcher()
-
-
Method Details
-
hasPlaceholders
Check if expected output contains any placeholders.- Parameters:
expected- The expected output template- Returns:
- true if at least one {{Type}} placeholder is present
-
matches
Match expected output (with placeholders) against actual output.- Parameters:
expected- The expected output template containing {{Type}} placeholdersactual- The actual output from test execution- Returns:
- true if actual output matches the expected template
-
validatePlaceholders
-
getSupportedPlaceholders
-