Tests should validate all expected behaviors, variants, and edge cases rather than covering only the happy path. When implementing tests, ensure you include scenarios for all relevant configurations, types, or levels that your code supports.
Key practices:
# ruleid: test-name
comments) to verify functionalitystring
type matching, also test char*
)Example from rule testing:
# Instead of only testing one severity level:
rules:
- id: critical
severity: CRITICAL
# Test multiple levels:
rules:
- id: critical-test
severity: CRITICAL
- id: high-test
severity: HIGH
- id: medium-test
severity: MEDIUM
This approach prevents silent failures when mappings or configurations change and ensures robust validation of your code’s behavior across all supported scenarios.
Enter the URL of a public GitHub repository