Idris2/tests/codegen/enum/Check.idr
Stefan Höck b697cea6e2
[ refactor ] use BitsXY for enum types during codegen (#2692)
* [ refactor ] use Bits32 for enum types during codegen

* [ test ] add test case

* [ test ] restore vmcode test result

* [ fix ] more B32 conversions

* [ refactor ] flexible ENUM representation

* [ text ] fix codegen test
2022-09-30 08:16:32 +01:00

19 lines
489 B
Idris

import Data.List
import Data.String
import System.File
path : String
path = "build/exec/enum_app/enum.ss"
mainLine : String -> Bool
mainLine str =
("(define Enum-main(" `isPrefixOf` str) && (" 120 17))))" `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 "Enum conversion optimized away"
False => putStrLn "Failed to optimize away enum conversion"