[GRASS-git] [OSGeo/grass] 011921: g.md2man: Expand tests on other cases (#7679)
Edouard Choinière
noreply at github.com
Mon Jul 13 03:02:50 PDT 2026
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 011921fd74d825d0bb7acc007409e99801804824
https://github.com/OSGeo/grass/commit/011921fd74d825d0bb7acc007409e99801804824
Author: Edouard Choinière <27212526+echoix at users.noreply.github.com>
Date: 2026-07-13 (Mon, 13 Jul 2026)
Changed paths:
M utils/g.md2man/tests/g_md2man_test.py
Log Message:
-----------
g.md2man: Expand tests on other cases (#7679)
CodeQL Code Quality had some AI findings on a recently changed file, a test file for g.md2man. The tests suggested seemed legitimate, and they are passing. I am thus submitting them here, after testing them in my fork.
Original text explaining the findings:
-------
The test asserts that there are exactly 3 bullet list markers for the input `"- first\n- second\n - nested\n"`, but this input only has 3 items (first, second, nested). The assertion `== 3` may be correct, but it should be verified that the nested item also produces the same `.IP \(bu 4n` marker, since nested items could produce a different marker format. If the nested list intentionally uses the same marker, this is fine, but the test name `test_unordered_list_nested` suggests the nesting behavior is what's being tested, and there is no assertion verifying that the nested item is actually rendered as nested (e.g., inside `.RS`/`.RE` blocks relative to the parent items). Consider adding an assertion that checks the order of `.RS`, `.IP`, and `.RE` to confirm correct nesting structure.
----------
The `test_comment_parsing_unit` test covers multi-line and inline comments, but there is no unit test for `strip_html_comments` behavior inside a fenced code block (i.e., that a comment inside a fence is preserved). The integration test `test_comment_kept_in_fenced_code` covers this via subprocess, but a direct unit test of `strip_html_comments` with a fenced block containing a comment would provide more precise coverage of that branch in `gmd.py`.
* Apply suggested fix to utils/g.md2man/tests/g_md2man_test.py from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to utils/g.md2man/tests/g_md2man_test.py from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply ruff format
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list