Skip to content

Commit

Permalink
chore: test was spuriously failing, but unnoticed
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Dec 2, 2024
1 parent cfb3daa commit d822d63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Tests.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ elab "#test_slicing" s:str out:ident c:command : command => do

let mut log := ""

log := log ++ s!"Original:\n{Syntax.prettyPrint c}"
log := log ++ s!"Residual:\n{Syntax.prettyPrint residual}"
log := log ++ s!"Original:\n{Syntax.prettyPrint c}\n"
log := log ++ s!"Residual:\n{Syntax.prettyPrint residual}\n"
for (s, stx) in sliced.toArray do
log := log ++ s!"Slice {s}:\n{Syntax.prettyPrint stx}"
log := log ++ s!"Slice {s}:\n{Syntax.prettyPrint stx}\n"

let use := s.getString
if let some stx := sliced[use]? then
Expand Down Expand Up @@ -49,7 +49,7 @@ def heya : IO Unit := do
pure ()

def expectedLog :=
"Original:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n -- !! begin foo\n IO.println \" there\"\n /- Bigger comment\n -/\n -- !! end foo\n let x := 33 -- !! begin foo\n if x > 3 then pure () -- !! end foo\n if x == 3 /-\n !! begin foo\n -/ || true /- !! end foo -/ then pure ()\n let x := [1, 2/- !! begin foo-/, 3/- !! end foo-/]\n pure ( ) Residual:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n let x := 33 \n if x == 3 then pure ()\n let x := [1, 2]\n pure ( ) Slice foo:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n IO.println \" there\"\n /- Bigger comment\n -/\n let x := 33 \n if x > 3 then pure () \n if x == 3 || true then pure ()\n let x := [1, 2, 3]\n pure ( ) "
"Original:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n -- !! begin foo\n IO.println \" there\"\n /- Bigger comment\n -/\n -- !! end foo\n let x := 33 -- !! begin foo\n if x > 3 then pure () -- !! end foo\n if x == 3 /-\n !! begin foo\n -/ || true /- !! end foo -/ then pure ()\n let _ := [1, 2/- !! begin foo-/, 3/- !! end foo-/]\n pure ()\nResidual:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n let x := 33 \n if x == 3 then pure ()\n let _ := [1, 2]\n pure ()\nSlice foo:\ndef heya : IO Unit := do\n IO.print \"Hey\"\n IO.println \" there\"\n /- Bigger comment\n -/\n let x := 33 \n if x > 3 then pure () \n if x == 3 || true then pure ()\n let _ := [1, 2, 3]\n pure ()\n"

end

Expand Down Expand Up @@ -144,6 +144,7 @@ def main : IO UInt32 := do
IO.println sliceLog
IO.println "and actual:"
IO.println expectedLog
return 1

IO.println "Checking that the TOML project will load"
cleanupDemo (demo := "demo-toml")
Expand Down

0 comments on commit d822d63

Please sign in to comment.