summaryrefslogtreecommitdiffstatshomepage
AgeCommit message (Collapse)Author
2023-05-07Merge pull request #290 from kimshrier/exercise_096_fix_exampleChris Boesch
Fix reference to slice_ptr in example code
2023-05-07Merge pull request #289 from kimshrier/exercise_092_typoChris Boesch
Remove repeated word "with"
2023-05-07Merge pull request #288 from kimshrier/exercise_076_typoChris Boesch
Add missing word "of"
2023-05-07Merge pull request #287 from kimshrier/exercise_072_typoChris Boesch
Add missing word "to"
2023-05-07Merge pull request #286 from kimshrier/exercise_001_typoChris Boesch
fix typo well -> will
2023-05-07Fix reference to slice_ptr in example codeKim SHrier
2023-05-07Remove repeated word "with"Kim SHrier
2023-05-07Add missing word "of"Kim SHrier
2023-05-07add missing word "to"Kim SHrier
2023-05-06fix typo well -> willKim SHrier
2023-05-06Merge pull request #285 from chrboesch/improve_instructionChris Boesch
Improve instructions.
2023-05-06Merge branch 'main' into improve_instructionChris Boesch
2023-05-06Improve instructions.Chris Boesch
2023-05-06Merge pull request #284 from perillo/improve-exercise-type-moreChris Boesch
Improve Exercise type more
2023-05-06build: improve Exercise.addExecutableManlio Perillo
Replace the file_path variable with path.
2023-05-06build: use multiline string literals when necessaryManlio Perillo
Update the output and hint fields in the `exercises` slice to use a multiline string literal when the string have multiple lines or use the `"` character. This will greatly improve readability. Additionally, remove the trailing whitespace on each line and check it in the validate_exercises function. Update the output comparison logic in ZiglingStep, since the current code assumes that the string has only one line. Update test/tests.zig to use the new `CheckNamedStep` in test case 1, since RunStep.StdIo.Check is no longer able to correctly check the output. Fixes #283
2023-05-06build: remove assertion in `Exercise.key`Manlio Perillo
Use `orelse unreachable` instead, in order to simplify the code. Fix doc-comments in the Exercise type.
2023-05-06build: make `Exercise.hint` optionalManlio Perillo
Use an optional type, instead of an empty string, since it is more idiomatic.
2023-05-05Ex 101: Magic bags better than buckets for metaphorsDave Gauer
2023-05-05Merge pull request #281 from perillo/add-healed-path-optionChris Boesch
Add the -Dhealed-path option
2023-05-05build: add the healed-path optionManlio Perillo
This is necessary in the unit tests, to ensure each test case use a different exercises directory. Update test/tests.zig to use the new healed-path option, ensuring that each temp directory is removed. In test case 3, 4 and 5, move case_step as the first step in the dependency chain. This will improve the build summary tree. In test case 5, remove the dependency to heal_step, since it is not necessary.
2023-05-05Merge pull request #280 from arnon4/patch-1Chris Boesch
Fixed example syntax for inline else
2023-05-05Fixed example syntax for inline elseArnon
2023-05-04Merge branch 'main' of github.com:ratfactor/ziglingsDave Gauer
2023-05-04Ex 001 remove ancient script reference + wordingDave Gauer
2023-05-04test: remove obsolete comment in the heal functionManlio Perillo
Remove the comment about using POSIX patch variant, since we now use the -s option.
2023-05-04test: fix doc-commentsManlio Perillo
CheckStep, FailStep, fail, HealStep and heal incorrectly used a normal comment, instead of a doc-comment. Additionally, improve the documentation for FailStep and HealStep.
2023-05-04test: improve test case 1 and 2Manlio Perillo
In test case 1 and 2, remove the `i` variable and use `ex.number()` instead. In test case 2, when checking the exercise output from stderr, also check that stdout is empty and vice versa.
2023-05-04Merge pull request #265 from Arya-Elfren/methods-clarificationDave Gauer
Clarify the methods syntax sugar & a bit more
2023-05-04Merge pull request #264 from Arya-Elfren/float-clarificationDave Gauer
Clarify `f16` maths - closes #204
2023-05-03Merge pull request #279 from perillo/refactor-zigling-step-2Chris Boesch
Refactor ZiglingStep
2023-05-03build: improve coding style in ZiglingStepManlio Perillo
- Use an anonymous struct when initializing std.Build.Step. - Rename the builder parameter in the create method to b - Avoid lines too long Additionally: - In the run method, rename output to raw_output in order to make the next variable names shorter. - In the compile method, rename zig_file to path.
2023-05-03build: use @panic("OOM") instead of unreachableManlio Perillo
The code in ZiglingStep copied the error handling used in std.Build in the past. Use @panic("OOM") when the error is caused by the allocator failing to allocate memory.
2023-05-03build: improve the exercise output checkManlio Perillo
Make the error message consistent with the one in std.Build.RunStep, using the "=" character instead of "-" and correctly aligning the text.
2023-05-03build: don't use @This() in ZiglingStepManlio Perillo
Use ZiglingStep, instead. This is consistent with the coding style in std.Build.
2023-05-03build: remove ZiglingStep.builder fieldManlio Perillo
It is not necessary, since the builder is available in self.step.owner.
2023-05-03build: use Child.exec in ZiglingStep.runManlio Perillo
Update the run method to use Child.exec, instead of Child.spawn followed by Child.wait. This simplifies the code.
2023-05-03build: fix incorrect error handling in ZiglingStep.compileManlio Perillo
When handling the error from the eval method, some possible errors are ignored. The make method will only print the exercise hint and the help message. Print the unexpected error message, in the else prong. Note that FileNotFound can also be considered unexpected.
2023-05-03build: remove the ZiglingStep.makeInternal methodManlio Perillo
Rename the doCompile method to compile and add the run method. The two methods are now called from the make method. Add the help method, since the error handling of compile and run methods are now separate. Remove the obsolete comment for the compile method.
2023-05-02Merge pull request #275 from perillo/heal-only-in-testChris Boesch
Heal only in test
2023-05-02Added Ex 101 "for loops part 5" (Closes #271)Dave Gauer
Also gave a shot at explaining data-oriented design, a Zig "hot topic" ever since the red Hawaiian shirt talk(s).
2023-05-02Restore unit testsManlio Perillo
2023-05-02test: don't run heal during configuration phaseManlio Perillo
In order to simplify the code, the heal function is called during the configuration phase, thus resulting in the function being always called when the build.zig file is run. This behavior unfortunately causes a serious issue when the user fix a broken exercise and, during the next step, the heal function tries to heal the fixed exercise resulting in GNU patch assuming an attempt to reverse a patch, waiting for input from the terminal. Run the heal function from the new HealStep step, so that it is called only during tests. Rename the outdir constant to work_path, for consistency with build.zig. Fixes #272
2023-05-01Merge pull request #273 from chrboesch/patch_errorChris Boesch
cli tests removed to solve 272
2023-05-01comment for the issue addedChris Boesch
2023-05-01 unit tests temporarily disabledChris Boesch
2023-05-01cli tests removed to solve 272Chris Boesch
2023-05-01Merge pull request #270 from perillo/improve-exercise-typeChris Boesch
Improve the Exercise type
2023-05-01build: don't override the top level stepsManlio Perillo
When running `zig build -Dn=n`, the install and uninstall steps where overridden in order to improve the description. In recent version of Zig this is no longer allowed.
2023-05-01build: rename Exercise.baseName to nameManlio Perillo
The name "baseName" is confusing, since it refers to the UNIX basename command, and not to the basename function in some programming languages including Zig. Use the std.fs.path.stem function to remove the file extension, instead of slicing. Remove the use of the assertion, since it is no longer necessary. Instead, add a check to ensure that the exercise must be a Zig source file in the validate_exercises function. Update the validate_exercises function to check the last exercise, too.