This PR ensures that for modules opted into the experimental module system, we do not import module docstrings or declaration ranges. Excluding declaration docstrings as well would require some more work to make `[inherit_doc]` leave a mere reference to the other declaration instead of copying its docstring eagerly.
23 lines
848 B
Text
23 lines
848 B
Text
module
|
|
|
|
import Lean
|
|
import Module.Basic
|
|
|
|
/-! # Module system basic tests -/
|
|
|
|
open Lean
|
|
|
|
/-! Non-essential metadata should only be accessible at level >= .server -/
|
|
|
|
#eval show IO Unit from do
|
|
let env ← importModules (level := .exported) #[`Module.Basic] {}
|
|
assert! env.header.isModule
|
|
let _ ← Core.CoreM.toIO (ctx := { fileName := "module.lean", fileMap := default }) (s := { env }) do
|
|
assert! (← findDeclarationRanges? ``f).isNone
|
|
assert! (getModuleDoc? (← getEnv) `Module.Basic).any (·.size == 0)
|
|
|
|
#eval show IO Unit from do
|
|
let env ← importModules (level := .server) #[`Module.Basic] {}
|
|
let _ ← Core.CoreM.toIO (ctx := { fileName := "module.lean", fileMap := default }) (s := { env }) do
|
|
assert! (← findDeclarationRanges? ``f).isSome
|
|
assert! (getModuleDoc? (← getEnv) `Module.Basic).any (·.size == 1)
|