test: add test for getModuleDoc?

This commit is contained in:
Leonardo de Moura 2021-08-06 14:14:22 -07:00
parent f2bbe222d7
commit 9dc2a4240d
2 changed files with 10 additions and 0 deletions

View file

@ -8,6 +8,14 @@ def tst : MetaM Unit := do
let docs := getMainModuleDoc (← getEnv)
IO.println <| docs.toList.map repr
def printDoc (moduleName : Name) : MetaM Unit := do
match getModuleDoc? (← getEnv) moduleName with
| some docs => IO.println <| docs.toList.map repr
| _ => throwError "module not found"
/-! Another module doc. -/
#eval tst
#eval printDoc `Lean.Meta.ReduceEval
#eval printDoc `Lean.Data.Lsp.Communication

View file

@ -1 +1,3 @@
["Testing module documentation. ", "Another module doc. "]
["Evaluation by reduction "]
["Reading/writing LSP messages from/to IO handles. "]