Skip to content

docs: clarify __split comma escaping and empty delimiter behavior - #6913

Open
QAInsights wants to merge 1 commit into
apache:masterfrom
QAInsights:docs/clarify-split-function
Open

QAInsights wants to merge 1 commit into
apache:masterfrom
QAInsights:docs/clarify-split-function

Conversation

@QAInsights

Copy link
Copy Markdown
Contributor

Description

Clarifies the __split function parameter documentation in xdocs/usermanual/functions.xml:

  • Under String to split: explained that literal strings containing commas must escape each comma with \, (e.g. ${__split(a\,b\,c,VAR)}) because unescaped commas separate function arguments, whereas values stored in a JMeter variable can be passed directly (e.g. ${__split(${VAR},VAR)}) without escaping commas.
  • Under Delimiter: noted that an omitted or empty delimiter defaults to ,, matching SplitFunction.java.

Motivation and Context

Fixes #4524. Users calling __split with the default comma delimiter were unsure whether commas in the input string needed to be escaped when passed directly versus via a JMeter variable, and the documentation did not mention that an empty delimiter also falls back to ,.

How Has This Been Tested?

  • Verified the empty-delimiter fallback behavior in src/functions/src/main/java/org/apache/jmeter/functions/SplitFunction.java.
  • Ran ./gradlew --quiet :src:dist:previewSite -x :src:dist:javadocAggregate autostyleCheck rat on Windows (all passed with exit code 0).
  • Verified the rendered src/dist/build/site/usermanual/functions.html output.

Screenshots (if appropriate):

N/A (documentation-only changes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

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.

__splitString behaviour is not intuitive and documentation is not explicit enough

1 participant