Skip to content

Commit 3027005

Browse files
committed
Fixing generation of tests files when the
name of a test contains "*/".
1 parent acb0ca4 commit 3027005

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Changed
99
- cyril-verloop/codingame-configuration 1.13.0 => 1.13.1.
1010

11+
### Fixed
12+
- generation of tests files when the name of a test contains "*/".
13+
1114
## [6.4.0] - 2025-03-31
1215
### Changed
1316
- cyril-verloop/codingame-configuration 1.12.0 => 1.13.0.

templates/CGTest.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class CGTest extends CGTestCase
2626
{% for test in configuration.testConfigurations %}
2727
2828
/**
29-
* Tests the code with "{{ test.name|raw }}".
29+
* Tests the code with "{{ test.name|replace({'*/': '* /'})|raw }}".
3030
*/
3131
#[
3232
PA\Group('{{ configuration.group }}_{{ test.group }}'),

tests/Generator/CGTestGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testGenerateTheTestFile(): void
6666
'01 - test file.txt'
6767
);
6868
$TestConfiguration2 = new TestConfiguration(
69-
'Test name 2',
69+
'Test name with */',
7070
'testGroup2',
7171
'TestMethod2',
7272
'02 - test file 2.txt'

tests/Generator/Example/CGTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public function testTestMethod(): void
4040
}
4141

4242
/**
43-
* Tests the code with "Test name 2".
43+
* Tests the code with "Test name with * /".
4444
*/
4545
#[
4646
PA\Group('anAlphanumName_testGroup2'),
47-
PA\TestDox('Test name 2')
47+
PA\TestDox('Test name with */')
4848
]
4949
public function testTestMethod2(): void
5050
{

tests/Generator/Example/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"file": "01 - test file.txt"
1111
},
1212
{
13-
"name": "test name 2",
13+
"name": "test name with */",
1414
"alphanumName": "testAlphanumName2",
1515
"file": "02 - test file 2.txt"
1616
}

0 commit comments

Comments
 (0)