Skip to content

Commit

Permalink
test: toExpr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Feb 23, 2024
1 parent feb0195 commit 81a57a0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/lean/toExpr.lean
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 10 additions & 0 deletions tests/lean/toExpr.lean.expected.out
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 81a57a0

Please sign in to comment.