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

85 lines
1 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

universe u v
-- set_option pp.binderTypes false
set_option pp.explicit true
namespace x1
def f (x : Bool) (y z : Nat) : Nat :=
match x with
| true => y
| false => z + y + y
end x1
namespace x2
def f (x : Nat) : Nat := x
end x2
namespace x3
def f (x y : Nat) : Nat := x
end x3
namespace x4
@[noinline] def h (x y : Nat) : Nat := x + y
def f1 (x y : Nat) : Nat :=
h x y
def f2 (x y : Nat) : Nat :=
h (h x y) (h y x)
def f3 (x y : Nat) : Nat :=
h (h x x) x
def f4 (x y : Nat) : Nat :=
h (h 1 0) x
def f5 (x y : Nat) : Nat :=
h (h 1 1) x
end x4
namespace x5
partial def myMap {α : Type u} {β : Type v} (f : α → β) : List α → List β
| [] => []
| x::xs => f x :: myMap f xs
end x5
namespace x6
@[noinline] def act : StateM Nat Unit :=
modify (fun a => a + 1)
def f : StateM Nat Unit :=
act *> act
end x6
namespace x7
inductive S
| v1 | v2 | v3
def foo : S → S × S
| S.v1 => (S.v2, S.v1)
| S.v2 => (S.v3, S.v2)
| S.v3 => (S.v1, S.v2)
end x7
namespace x8
def f (x : Nat) : List Nat :=
x :: x :: []
end x8