From be8dee6731f23462895484a91c815edcb70c116e Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 24 Jan 2025 15:00:35 -0800 Subject: [PATCH] test: Add test for module read --- Test/Environment.lean | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Test/Environment.lean b/Test/Environment.lean index b646279..c49cbae 100644 --- a/Test/Environment.lean +++ b/Test/Environment.lean @@ -110,6 +110,9 @@ def test_symbol_location : TestT IO Unit := do checkTrue "file" result.sourceUri?.isNone checkEq "pos" (result.sourceStart?.map (·.column)) <| .some 0 checkEq "pos" (result.sourceEnd?.map (·.column)) <| .some 88 + let .ok { imports, constNames, extraConstNames } ← Environment.moduleRead ⟨"Init.Data.Nat.Basic"⟩ | fail "Module read failed" + checkEq "imports" imports #["Init.SimpLemmas", "Init.Data.NeZero"] + checkTrue "constNames" $ constNames.contains "Nat.succ_add" def suite: List (String × IO LSpec.TestSeq) := [