From 87f1e24384a8d10700ab09734a15bb14b1703577 Mon Sep 17 00:00:00 2001 From: krangelov Date: Thu, 5 Aug 2021 20:45:08 +0200 Subject: [PATCH] started a testsuite --- src/runtime/haskell/pgf2.cabal | 7 ++++++- src/runtime/haskell/tests/basic.gf | 8 ++++++++ src/runtime/haskell/tests/basic.hs | 6 ++++++ src/runtime/haskell/tests/basic.pgf | Bin 0 -> 135 bytes 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/runtime/haskell/tests/basic.gf create mode 100644 src/runtime/haskell/tests/basic.hs create mode 100644 src/runtime/haskell/tests/basic.pgf diff --git a/src/runtime/haskell/pgf2.cabal b/src/runtime/haskell/pgf2.cabal index db7babb2f..2b1eaef4f 100644 --- a/src/runtime/haskell/pgf2.cabal +++ b/src/runtime/haskell/pgf2.cabal @@ -25,5 +25,10 @@ library extra-libraries: pgf cc-options: -std=c99 - default-language: Haskell2010 c-sources: utils.c + +test-suite basic + type: exitcode-stdio-1.0 + main-is: tests/basic.hs + default-language: Haskell2010 + build-depends: base, HUnit, pgf2 diff --git a/src/runtime/haskell/tests/basic.gf b/src/runtime/haskell/tests/basic.gf new file mode 100644 index 000000000..e54b628cc --- /dev/null +++ b/src/runtime/haskell/tests/basic.gf @@ -0,0 +1,8 @@ +abstract basic = { + +cat N ; + +fun Z : N ; + S : N -> N ; + +} diff --git a/src/runtime/haskell/tests/basic.hs b/src/runtime/haskell/tests/basic.hs new file mode 100644 index 000000000..bbb7b6c69 --- /dev/null +++ b/src/runtime/haskell/tests/basic.hs @@ -0,0 +1,6 @@ +import Test.HUnit +import PGF2 + +main = do + gr <- readPGF "tests/basic.pgf" + runTestTTAndExit (TestCase (assertEqual "abstract names" "basic" (abstractName gr))) diff --git a/src/runtime/haskell/tests/basic.pgf b/src/runtime/haskell/tests/basic.pgf new file mode 100644 index 0000000000000000000000000000000000000000..410358375d18dbccea24b6502378731afb7af18a GIT binary patch literal 135 zcmZQzVqj!oO-d}zOlDwW3}$3tjAvl<10e=R2KxsLV89rKCcwh#mXn`Y0+s|5%$|8j gJVrkTCb-^UI4cUQl!1YPEx4p8GcO&+Wnf?c06kd`G5`Po literal 0 HcmV?d00001