lean4-htt/tests/elab/versoDocSuggestionNoImport.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

50 lines
1.2 KiB
Text

set_option doc.verso true
/-!
When a builtin role name like {lit}`lit` is shadowed by a user definition, the suggestion should use
the qualified name {lit}`Lean.Doc.lit`. This test checks that this also works when there are no
imports.
-/
namespace ShadowedBuiltin
def lit := Nat -- Shadow the builtin 'lit' role
/--
warning: Code element could be more specific.
Hint: Insert a role to document it:
• {̲g̲i̲v̲e̲n̲}̲`test`
• Use the `lit` role:
{̲L̲e̲a̲n̲.̲D̲o̲c̲.̲l̲i̲t̲}̲`test`
to mark the code as literal text and disable suggestions
-/
#guard_msgs in
/--
`test`
-/
def testShadowedLit := 0
-- Verify that {Lean.Doc.lit} works when lit is shadowed
#guard_msgs in
/-- {Lean.Doc.lit}`qualified works` -/
def testQualifiedLit := 1
open Lean
-- Verify that {Doc.lit} works when lit is shadowed and Lean is not imported
#guard_msgs in
/-- {Doc.lit}`qualified works` -/
def testQualifiedLit2 := 1
-- {lit} fails when shadowed
/--
error: `lit : Type` is not registered as a a role
Hint: `lit` shadows a role. Use the full name of the shadowed role:
L̲e̲a̲n̲.̲D̲o̲c̲.̲lit
-/
#guard_msgs in
/-- {lit}`broken` -/
def testBrokenLit := 0
end ShadowedBuiltin