You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extra test cases may be supplied using
`.meta/additional-test-cases.json`.
Each exercise's `.meta/test_generator.py` defines `gen_case`, and
optionally `test_name`, `HEADER` and `sort_key`.
Generators are added for 63 exercises.
The generated tests are identical to the existing tests, except with
- affine-cipher
- connect
- wordy
Python style is enforced by ruff, run by pre-commit and a new
pre-commit workflow.
I used Claude for this PR.
Copy file name to clipboardExpand all lines: README.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ A good place to start in the docs is to understand how the [Hello World](https:/
72
72
73
73
#### How to implement a new exercise from start to finish
74
74
75
-
There are two ways to implement a practice exercise. You can follow all the 13 steps listed below from start to finish, or you can run `./bin/bootstrap_practice_exercise.sh [SLUG]` to create all the files and folders you'll need. This will allow you to skip a few steps and jump right into writing your example solution, but you'll need [bash](https://www.gnu.org/software/bash/) and [jq](https://stedolan.github.io/jq/) to run the script.
75
+
There are two ways to implement a practice exercise. You can follow all the 14 steps listed below from start to finish, or you can run `./bin/bootstrap_practice_exercise.sh [SLUG]` to create all the files and folders you'll need. This will allow you to skip a few steps and jump right into writing your example solution, but you'll need [bash](https://www.gnu.org/software/bash/) and [jq](https://stedolan.github.io/jq/) to run the script.
76
76
77
77
1. Pick an exercise from the [problem-specifications](https://github.com/exercism/problem-specifications/tree/main/exercises) repo.
78
78
2. Create a new entry for the exercise in [config.json](./config.json). Include
@@ -85,22 +85,23 @@ There are two ways to implement a practice exercise. You can follow all the 13 s
- `bin/configlet sync --update --tests include --exercise [SLUG]`
87
87
4. Create 3 files in the new directory (located at `exercises/practice/[SLUG]`):
88
-
- `run_test.v`
89
88
- `[SLUG].v`
90
89
- `.meta/example.v`
90
+
- `.meta/test_generator.py`
91
91
5. Write an example implementation in `[SLUG].v`
92
-
6. Write a test suite in `run_test.v` based on the canonical data in [problem-specifications](https://github.com/exercism/problem-specifications/tree/main/exercises). Here's an example of [canonical data](https://github.com/exercism/problem-specifications/blob/main/exercises/grade-school/canonical-data.json) and here's the [corresponding test suite](./exercises/practice/grade-school/run_test.v).
93
-
7. Run the test suite with `v -stats test run_test.v`
94
-
8. Once all tests pass, make sure code is formatted properly with `v fmt -w [V_FILE]` on all the v files (example and test files)
95
-
9. Copypaste everything in `[SLUG].v` into `.meta/example.v`
96
-
10. Remove everything from `[SLUG].v` except the stub of the needed function, the `module main` at the top, and make a stub of a struct or two.
97
-
11. Add needed info to the `...[SLUG]/.meta/config.json` file:
92
+
6. Write a test generator in `.meta/test_generator.py`. It will receive the canonical data in [problem-specifications](https://github.com/exercism/problem-specifications/tree/main/exercises). Here's an example of [canonical data](https://github.com/exercism/problem-specifications/blob/main/exercises/grade-school/canonical-data.json).
93
+
7. Generate `run_test.v` by running `generators/generate.py [SLUG]`
94
+
8. Run the test suite with `v -stats test run_test.v`
95
+
9. Once all tests pass, make sure code is formatted properly with `v fmt -w [V_FILE]` on all the v files (example and test files)
96
+
10. Copypaste everything in`[SLUG].v` into `.meta/example.v`
97
+
11. Remove everything from `[SLUG].v` except the stub of the needed function, the `module main` at the top, and make a stub of a struct or two.
98
+
12. Add needed info to the `...[SLUG]/.meta/config.json` file:
98
99
- Author's GitHub username
99
100
- solution file name (should be `[SLUG].v`)
100
101
- test file name (should be `run_test.v`)
101
102
- example solution file name (should be `.meta/example.v`)
102
-
12. Commit changes with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
103
-
13. Make your PR and do a little happy dance
103
+
13. Commit changes with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
Copy file name to clipboardExpand all lines: docs/INSTALLATION.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,4 @@ Please follow the [instructions in the official documentation](https://github.co
6
6
It is highly recommended that you install from source and then follow the [instructions on symlinking](https://github.com/vlang/v/blob/master/README.md#symlinking) to be able to run V anywhere.
7
7
8
8
## Using an IDE
9
-
The best way to use V in an IDE is to use the [VSCodium](https://vscodium.com/)[extension](https://marketplace.visualstudio.com/items?itemName=vlanguage.vscode-vlang). There is also support for [Vim](https://github.com/ollykel/v-vim), [Emacs](https://github.com/damon-kwok/v-mode), and [Sublime](https://github.com/elliotchance/vlang-sublime). To see a full list of supported IDEs, see the [V homepage](https://vlang.io/).
9
+
The best way to use V in an IDE is to use the [VSCodium](https://vscodium.com/)[extension](https://marketplace.visualstudio.com/items?itemName=vlanguage.vscode-vlang). There is also support for [Vim](https://github.com/ollykel/v-vim), [Emacs](https://github.com/damon-kwok/v-mode), and [Sublime](https://github.com/elliotchance/vlang-sublime). To see a full list of supported IDEs, see the [V homepage](https://vlang.io/).
0 commit comments