lean4-htt/tests/lean/run/versoDocNesting.lean
David Thrane Christiansen 5ce1f67261
fix: module docstring header nesting in Verso format (#11215)
This PR fixes an issue where header nesting levels were properly tracked
between, but not within, moduledocs.
2025-11-17 13:57:00 +00:00

58 lines
699 B
Text

set_option doc.verso true
/-!
This test checks that header nesting rules are enforced within and across Verso module docs.
First, within.
# A
## B
### C
-/
/-- error: Incorrect header nesting: expected at most `###` but got `####` -/
#guard_msgs in
/-!
# A
## B
#### C
-/
/-- error: Incorrect header nesting: expected at most `##` but got `###` -/
#guard_msgs in
/-!
# A
## B
### C
#### D
# E
### F
-/
/-!
Now, check between blocks.
# A
## B
-/
/-!
### C
-/
/-- error: Incorrect header nesting: expected at most `####` but got `#####` -/
#guard_msgs in
/-!
##### D
-/
/-!
# A
-/
/-- error: Incorrect header nesting: expected at most `##` but got `#####` -/
#guard_msgs in
/-!
##### B
-/