[PR] Add unit tests for ExpressionTokenizer [tomcat]
lihongyi87 (via GitHub) <[email protected]> Sun, 02 Aug 2026 03:59:09 -0000
| Newsgroups | gmane.comp.jakarta.tomcat.devel |
|---|---|
| Message-ID | <[email protected]> |
lihongyi87 opened a new pull request, #1035: URL: https://github.com/apache/tomcat/pull/1035 Adds direct unit tests for `org.apache.catalina.ssi.ExpressionTokenizer`, which currently has no dedicated test class. The tokenizer is only exercised indirectly through `ExpressionParseTree` in `TestExpressionParseTree`, which covers only 3 of the 12 token types (`TOKEN_STRING`, `TOKEN_EQ`, `TOKEN_END`). ## What is covered - All operator tokens: `(` `)` `=` `!=` `!` `||` `&&` `>` `>=` `<` `<=` - String values, including whitespace-separated multi-token expressions - Quoted strings (single and double quotes) and escaped quotes - Regular expression strings, including escaped slashes - Operators mixed with strings (e.g. `a && b`, `!a`, `a >= b`, `(a)`) - Edge cases: empty string, whitespace-only input (no tokens) ## Verification - All 30 parameterized cases pass - Full SSI test suite (`TestExpressionTokenizer`, `TestExpressionParseTree`, `TestRegExpCapture`, `TestSsiServlet`) passes on both NIO and NIO2 connectors -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]