Skip to content

✨ TestBootstrap: dump canonical-data - #1072

Merged
homersimpsons merged 1 commit into
mainfrom
chore/bootstrap-improvements
Nov 20, 2026
Merged

homersimpsons merged 1 commit into
mainfrom
chore/bootstrap-improvements

Conversation

@homersimpsons

Copy link
Copy Markdown
Contributor

Test properties excluded:

  • uuid, description: already outputted
  • reimplements: does not make sense
  • comments: usually provided for reimplements
  • scenarios: seems mostly empty

Use of VarExporter:

  1. It allows the contributor to copy-paste the code directly
  2. json_encode was too verbose (pretty print) or too hard to read (normal)
  3. VarExporter is already used by the generator

Output:

    /** uuid: 64d97c14-36dd-44a8-9621-2cecebd6ed23 */
    #[PHPUnit\Framework\Attributes\TestDox('Accumulate empty')]
    public function testAccumulateEmpty(): void
    {
        // [
        //     'property' => 'accumulate',
        //     'input' => [
        //         'list' => [],
        //         'accumulator' => '(x) => x * x',
        //     ],
        //     'expected' => [],
        // ]
        $this->markTestIncomplete('This test has not been implemented yet.');
    }

Comment thread contribution/main.php Resolved
@homersimpsons

Copy link
Copy Markdown
Contributor Author

Follow-up of #1071

@homersimpsons
homersimpsons requested a review from mk-mxp November 18, 2026 22:41

@mk-mxp mk-mxp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks a lot for your contribution.

@mk-mxp mk-mxp added x:action/improve Improve existing functionality/content x:knowledge/advanced Comprehensive Exercism knowledge required x:module/generator Work on Exercise generators x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises) x:size/medium Medium amount of work x:rep/medium Medium amount of reputation labels Nov 20, 2026
Test properties excluded:
- `uuid`, `description`: already outputted
- `reimplements`: does not make sense
- `comments`: usually provided for reimplements
- `scenarios`: seems mostly empty

Use of `VarExporter`:
1. It allows the contributor to copy-paste the code directly
2. `json_encode` was too verbose (pretty print) or too hard to read (normal)
3. `VarExporter` is already used by the generator

Output:
```php
    /** uuid: 64d97c14-36dd-44a8-9621-2cecebd6ed23 */
    #[PHPUnit\Framework\Attributes\TestDox('Accumulate empty')]
    public function testAccumulateEmpty(): void
    {
        // [
        //     'property' => 'accumulate',
        //     'input' => [
        //         'list' => [],
        //         'accumulator' => '(x) => x * x',
        //     ],
        //     'expected' => [],
        // ]
        $this->markTestIncomplete('This test has not been implemented yet.');
    }
```
@homersimpsons
homersimpsons force-pushed the chore/bootstrap-improvements branch from cf64879 to 354151f Compare November 20, 2026 23:08
@homersimpsons
homersimpsons merged commit 97307a1 into main Nov 20, 2026
18 checks passed
@homersimpsons
homersimpsons deleted the chore/bootstrap-improvements branch November 20, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/improve Improve existing functionality/content x:knowledge/advanced Comprehensive Exercism knowledge required x:module/generator Work on Exercise generators x:rep/medium Medium amount of reputation x:size/medium Medium amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants