test: toExpr tests

This commit is contained in:
Leonardo de Moura 2024-02-23 14:37:20 -08:00 committed by Leonardo de Moura
parent c48d020255
commit 51fe66b9eb
2 changed files with 31 additions and 0 deletions

21
tests/lean/toExpr.lean Normal file
View file

@ -0,0 +1,21 @@
import Lean
open Lean BitVec
open Meta in
def test [ToExpr α] (a : α) : MetaM Unit := do
let e := toExpr a
let type ← inferType e
check e
logInfo m!"{e} : {type}"
run_meta test (2 : Fin 4)
run_meta test (8 : Fin 5)
run_meta test (300#8)
run_meta test (300#32)
run_meta test (58#8)
run_meta test (20 : UInt8)
run_meta test (30 : UInt16)
run_meta test (40 : UInt32)
run_meta test (50 : UInt64)
run_meta test (60 : USize)

View file

@ -0,0 +1,10 @@
2 : Fin 4
3 : Fin 5
44#8 : BitVec 8
300#32 : BitVec 32
58#8 : BitVec 8
20 : UInt8
30 : UInt16
40 : UInt32
50 : UInt64
60 : USize