Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GasStationManager committed Nov 20, 2024
1 parent 0def6e7 commit 6be422d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/addFalse/bad.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Batteries.Tactic.OpenPrivate

open private mk from Lean.Environment

open Lean in
elab "add_false" : command => do
modifyEnv fun env =>
let constants := env.constants.insert `false $ ConstantInfo.thmInfo
{ name := `false, levelParams := [], type := .const ``False [], value := .const ``False [] }
-- Before `Environment.mk` became private, we could just use
-- `{ env with constants }`
mk env.const2ModIdx constants env.extensions env.extraConstNames env.header

add_false

theorem falseThm : False :=
false
5 changes: 5 additions & 0 deletions tests/addFalse/target.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@




theorem falseThm : False := sorry
24 changes: 24 additions & 0 deletions tests/addFalseConstr/bad.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Batteries.Tactic.OpenPrivate

open private mk from Lean.Environment

open Lean in
elab "add_false_constructor" : command => do
modifyEnv fun env =>
let constants := env.constants.insert `False.intro $ ConstantInfo.ctorInfo
{ name := `False.intro
levelParams := []
type := .const ``False []
induct := `False
cidx := 0
numParams := 0
numFields := 0
isUnsafe := false }
-- Before `Environment.mk` became private, we could just use
-- `{ env with constants }`
mk env.const2ModIdx constants env.extensions env.extraConstNames env.header

add_false_constructor

theorem falseThm : False :=
False.intro
2 changes: 2 additions & 0 deletions tests/addFalseConstr/target.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

theorem falseThm : False := sorry

0 comments on commit 6be422d

Please sign in to comment.