Describe the bug
Spock fails with tr_TR locale:
D:\a\jmeter\jmeter\src\core\src\test\groovy\org\apache\jmeter\engine\util\FunctionParserSpec.groovy: 31: Unrecognized block label: given @ line 31, column 13.
CompoundVariable.functions.put('__func', Func.class)
^
It blocks JMeter testing :-/
apache/jmeter#693
Reason:
Spock uses .toLowerCase() for BlockParseInfo:
|
public String toString() { |
|
return super.toString().toLowerCase(); |
|
} |
The lookup fails here:
|
if (!label.equals(blockInfo.toString())) continue; |
|
|
|
checkIsValidSuccessor(method, blockInfo, stat.getLineNumber(), stat.getColumnNumber()); |
|
Block block = blockInfo.addNewBlock(method); |
|
String description = getDescription(stat); |
|
if (description == null) |
|
block.getAst().add(stat); |
|
else |
|
block.getDescriptions().add(description); |
|
|
|
return block; |
|
} |
|
|
|
throw new InvalidSpecCompileException(stat, "Unrecognized block label: " + label); |
Sample code in question (I believe it does not matter):
import org.apache.jmeter.functions.Function
import org.apache.jmeter.samplers.SampleResult
import org.apache.jmeter.samplers.Sampler
import spock.lang.Specification
import spock.lang.Unroll
@Unroll
class FunctionParserSpec extends Specification {
def "function '#value' gets compiled"() {
given:
CompoundVariable.functions.put('__func', Func.class)
def parser = new FunctionParser()
when:
def result = parser.compileString(value)
then:
"$result" == "$expected"
where:
value | expected
'${__func()}' | [new Func()]
'${ __func()}' | [new Func()]
'${__func() }' | [new Func()]
'${ __func() }' | [new Func()]
}
To Reproduce
run any Spock test with -Duser.country=TR -Duser.language=tr
Expected behavior
tr_TR should be supported
Actual behavior
Unrecognized block label: given @ line 31, column 13
Java version
8, 11, 17
Buildtool version
Gradle 7.3
What operating system are you using
Windows
Dependencies
I believe it is irrelevant
Additional context
No response
Describe the bug
Spock fails with
tr_TRlocale:It blocks JMeter testing :-/
apache/jmeter#693
Reason:
Spock uses
.toLowerCase()forBlockParseInfo:spock/spock-core/src/main/java/org/spockframework/compiler/model/BlockParseInfo.java
Lines 139 to 141 in 3ebb5d3
The lookup fails here:
spock/spock-core/src/main/java/org/spockframework/compiler/SpecParser.java
Lines 212 to 225 in 3ebb5d3
Sample code in question (I believe it does not matter):
To Reproduce
run any Spock test with
-Duser.country=TR -Duser.language=trExpected behavior
tr_TR should be supported
Actual behavior
Unrecognized block label: given @ line 31, column 13
Java version
8, 11, 17
Buildtool version
Gradle 7.3
What operating system are you using
Windows
Dependencies
I believe it is irrelevant
Additional context
No response