skinny85 / specnaz

Library for writing beautiful, RSpec/Jasmine/Mocha/Jest-style specifications in Java, Kotlin and Groovy
Other
34 stars 8 forks source link

Allow `$` in parameter placeholder expansion #17

Closed skinny85 closed 3 years ago

skinny85 commented 3 years ago

There was a bug in the way parameter placeholder expansion was done in parametrized tests. If the value of a parameter was a string containing the $ character, an attempt of substituting the placeholder with that value would result in an exception being thrown.

The reason for the bug was incorrectly using the String.replaceAll() method, which actually treats the $ and \ characters specially in the replacement string. The solution is to escape that string using the Matcher.quoteReplacement() method.

Fixes #16