Files
lean4/tests/elab/library_suggestions_persistent_module.lean
Garmelon 08eb78a5b2 chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

36 lines
1.2 KiB
Lean4

-- It's critical that this test remains a `module`:
-- its purpose is to test the availability of the selector in modules.
module
import Lean
/-!
# Test that library suggestions persist across file boundaries
This test verifies that the default library suggestion engine set in
`Lean.LibrarySuggestions.Default` is correctly persisted when imported via `Lean.LibrarySuggestions`.
We do NOT call `set_library_suggestions` in this file - the selector should
already be set from importing Lean.LibrarySuggestions (which imports Default).
-/
/--
info: ✓ Selector registered in imported state
---
info: ✓ getSelector succeeded
-/
#guard_msgs in
open Lean Lean.LibrarySuggestions in
run_cmd do
-- Check if a selector is registered
let hasSelector := (librarySuggestionsExt.getState ( getEnv)).isSome
if hasSelector then
Lean.logInfo "✓ Selector registered in imported state"
-- Try to retrieve the selector using getSelector
Elab.Command.liftTermElabM do
let selector? getSelector
match selector? with
| none => Lean.logInfo " ❌ getSelector returned none"
| some _ => Lean.logInfo " ✓ getSelector succeeded"
else
Lean.logInfo "❌ No selector registered in imported state!"