Skip to content

Add unit tests for ExpressionTokenizer - #1035

Open
lihongyi87 wants to merge 1 commit into
apache:11.0.xfrom
lihongyi87:add-tests-expressiontokenizer
Open

Add unit tests for ExpressionTokenizer#1035
lihongyi87 wants to merge 1 commit into
apache:11.0.xfrom
lihongyi87:add-tests-expressiontokenizer

Conversation

@lihongyi87

Copy link
Copy Markdown

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

@lihongyi87
lihongyi87 force-pushed the add-tests-expressiontokenizer branch from 35a205d to b4dfcd8 Compare August 2, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant