Idris2/tests/chez/nat2fin/Check.idr

19 lines
476 B
Idris
Raw Normal View History

2022-09-29 16:36:32 +03:00
import Data.List
import Data.String
import System.File
path : String
path = "build/exec/test_app/test.ss"
mainLine : String -> Bool
mainLine str =
("(define Main-main(" `isPrefixOf` str) && (" 375))))" `isInfixOf` str)
main : IO ()
main = do
Right str <- readFile path
| Left err => putStrLn "Error when reading \{path}"
case any mainLine (lines str) of
True => putStrLn "natToFinLt optimized away"
False => putStrLn "failed to optimize away natToFinLt"