Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Sep 9, 2024
1 parent e740718 commit 2a95bd7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Init/Data/Array/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def elem [BEq α] (a : α) (as : Array α) : Bool :=
(true, r)

/-- Convert a `Array α` into an `List α`. This is O(n) in the size of the array. -/
-- This function is exported to C, where it is called by `Array.data`
-- This function is exported to C, where it is called by `Array.toList`
-- (the projection) to implement this functionality.
@[export lean_array_to_list]
def toListImpl (as : Array α) : List α :=
Expand Down
2 changes: 1 addition & 1 deletion src/library/constants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ And.rec
And.casesOn
Array
Array.sz
Array.data
Array.toList
autoParam
bit0
bit1
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/liasolver.lean
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,5 @@ def main (args : List String) : IO UInt32 := do
IO.println "UNSAT"
| Solution.sat assignment =>
IO.println "SAT"
IO.println <| String.intercalate " " <| assignment.data.map toString
IO.println <| String.intercalate " " <| assignment.toList.map toString
return 0
2 changes: 1 addition & 1 deletion tests/compiler/array.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Array.casesOn (motive := fun _ => Nat) a (fun data => data.length)

@[noinline] def g (a : Array Nat) : List Nat :=
a.data
a.toList

@[noinline] def h (a : List Nat) : List Nat :=
g (Array.mk a)
Expand Down
4 changes: 2 additions & 2 deletions tests/lean/run/PPTopDownAnalyze.lean
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ set_option pp.proofs.withType false in

end proofs

#testDelab ∀ (α : Type u) (vals vals_1 : List α), { data := vals : Array α } = { data := vals_1 : Array α }
expecting ∀ (α : Type u) (vals vals_1 : List α), { data := vals : Array α } = { data := vals_1 }
#testDelab ∀ (α : Type u) (vals vals_1 : List α), { toList := vals : Array α } = { toList := vals_1 : Array α }
expecting ∀ (α : Type u) (vals vals_1 : List α), { toList := vals : Array α } = { toList := vals_1 }

#testDelab (do let ctxCore ← readThe Core.Context; pure ctxCore.currNamespace : MetaM Name)
expecting do
Expand Down
2 changes: 1 addition & 1 deletion tests/lean/run/structInstFast.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ where go (val : TSyntax `ident) (width depth : Nat) (cmds : Array <| TSyntax `co
let cmd : TSyntax `command := ⟨mkNullNode cmds⟩
`($cmd:command)
| m+1 =>
let len := cmds.data.length
let len := cmds.toList.length
let newTerm (s : String) := if len = 1 then baseTypeIdent else mkIdent' s (m+1)
let newTerm' (s : String) := if len = 1 then baseIdent else mkIdent' s (m+1)
let fieldsStx ← mkFieldsStx type (s!"x{m}_") width
Expand Down

0 comments on commit 2a95bd7

Please sign in to comment.