apache / apache/jmeter

__splitString behaviour is not intuitive and documentation is not explicit enough

Open
#4,524 3 comments 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

@pmouawad ([Bug 61626](https://bz.apache.org/bugzilla//show_bug.cgi?id=61626&redirect=false)):
__splitString has a counter intuitive behaviour when separator is "," (default one).

Problem 1:
Indeed, the String to split would need to be escaped which is in fact rarely the case when you need this function ?

Will String really contain:
"a\,b\,c"

Or :
"a,b,c"

Problem 2:
Also, when you by error input this:
${__split(a\,b\,c,varSplit,)}

It doesn't work because function uses empty separator which is wrong, as documentation says this parameter defaults to ",". So function should just ignore this empty .

Problem 2 can be fixed.
How to fix problem 1 ?

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.