Add ** include: directive for external file inclusion - #27
Open
stormi wants to merge 1 commit into
Open
Conversation
Author
|
Here's a test file that I haven't committed because the plotex project has no test framework at the moment, but that can be used to verify that the implementation does what it claims it does. |
Add support for including another test file at a point in the current test file with ** include: file.t The included file is parsed recursively — its tests, directives, and nested includes take effect as if pasted inline at the ** include: line. Paths are resolved relative to the including file's directory. Multiple ** include: lines are needed to include several files; each line includes exactly one file. - Circular include chains are detected and raise an error with the full cycle path (e.g. A -> B -> C -> A) - Duplicate test names across files raise an error showing both source files - All directives follow the same rules: ** game: overrides, ** precommand: appends, etc.
stormi
force-pushed
the
include-test-files
branch
from
July 26, 2026 10:39
6a1f06c to
da08273
Compare
Author
|
Last force-push: fixed stale commit message. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements #25
I have tested this on my own tests, with snippets that advance the game from one state to another, and others that move you to a given state from the beginning of the game.
Here's one that moves you from "parvis" to "chambre" :
And another that moves you from the beginning of the game to "chambre", by including other snippets:
In the real test files themselves, I include the file snippets that I need and either
{include}the "tests" they define via** precommandor directly in the tests, depending on the case.Example (WIP test file):