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

38 lines
1.2 KiB
Text

/-!
# Tests of `pp.oneline`
These tests are only making sure that `pp.online` renders correctly as a string.
There is also logic to preserve tags that is not being tested.
-/
set_option pp.oneline true
/-!
Prints something that fits in one line normally.
-/
/-- info: 1 + 1 : Nat -/
#guard_msgs in #check 1 + 1
/-!
Setting the width to 10 characters, truncates.
-/
/-- info: [1, 2, 3, [...] : List Nat -/
#guard_msgs in set_option format.width 10 in #check [1,2,3,4,5,6,7,8,9,10]
/-!
`let` prints across two lines, so truncates.
-/
/-- info: let x := 1; [...] : Nat -/
#guard_msgs in #check let x := 1; x + x
/-!
Doesn't truncate mid-token, but does truncate without regard for semantic position.
-/
/-- info: fun x1 [...] : Nat → [...] -/
#guard_msgs in set_option format.width 8 in #check fun x1 x2 x3 => (x1 + x2 + x3 : Nat)
/-- info: fun x1 x2 [...] : Nat → [...] -/
#guard_msgs in set_option format.width 9 in #check fun x1 x2 x3 => (x1 + x2 + x3 : Nat)
/-- info: fun x1 x2 [...] : Nat → [...] -/
#guard_msgs in set_option format.width 14 in #check fun x1 x2 x3 => (x1 + x2 + x3 : Nat)
/-- info: fun x1 x2 x3 => [...] : Nat → [...] -/
#guard_msgs in set_option format.width 15 in #check fun x1 x2 x3 => (x1 + x2 + x3 : Nat)