test: for isNoncomputable
This commit is contained in:
parent
9d6c26a4a6
commit
373a64ee09
2 changed files with 20 additions and 0 deletions
16
tests/lean/isNoncomputable.lean
Normal file
16
tests/lean/isNoncomputable.lean
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import Lean
|
||||
open Lean
|
||||
|
||||
def test (declName : Name) : MetaM Unit := do
|
||||
if isNoncomputable (← getEnv) declName then
|
||||
IO.println s!"{declName} is marked as noncomputable"
|
||||
else
|
||||
IO.println s!"{declName} is not marked as noncomputable"
|
||||
|
||||
noncomputable def foo (x : Nat) : Nat :=
|
||||
x + Classical.ofNonempty
|
||||
|
||||
#eval test ``List.map
|
||||
#eval test ``foo
|
||||
#eval test ``Classical.ofNonempty
|
||||
#eval test ``Array.map
|
||||
4
tests/lean/isNoncomputable.lean.expected.out
Normal file
4
tests/lean/isNoncomputable.lean.expected.out
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
List.map is not marked as noncomputable
|
||||
foo is marked as noncomputable
|
||||
Classical.ofNonempty is marked as noncomputable
|
||||
Array.map is not marked as noncomputable
|
||||
Loading…
Add table
Reference in a new issue