Open
Conversation
* Added `resolve_rules_dir` function to handle `--rules-dir` resolution. * Updated logging to display the resolved rules directory. * Added tests ensuring correct behavior for explicit `--rules-dir` usage, default rules-dir fallback, and invalid rules-dir handling.
Contributor
|
@NSoiffer asked me to take a look. The actual |
masonium
reviewed
Apr 10, 2026
| /// Verifies that the positional input-file argument still works on its own. | ||
| /// This keeps the default CLI file-input path covered while testing the rules-dir changes separately. | ||
| #[test] | ||
| fn still_accepts_input_file() { |
Contributor
There was a problem hiding this comment.
I don't think this test is really necessary. In practice I don't think you're really testing anything besides the argument parsing library itself.
| /// Verifies that `mathml2text` uses an explicitly provided `--rules-dir`. | ||
| /// This protects the CLI override path instead of silently falling back to the default rules location. | ||
| #[test] | ||
| fn accepts_explicit_rules_dir() { |
Contributor
There was a problem hiding this comment.
I would put most of this boiler plate code in a fixture structure, so you can reuse more of the logic.
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.
While testing out the mathml2text CLI, I noticed that
--rules-dirseems to not actually be used.For example, the following shouldn't work right?
cargo run --bin mathml2text -- --rules-dir /some/other/rulesRegarding the integration tests, I don't really know what I'm doing there.