File: test-hugs

package info (click to toggle)
haskell-quickcheck 2.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 432 kB
  • sloc: haskell: 5,104; sh: 32; makefile: 5
file content (26 lines) | stat: -rwxr-xr-x 528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

set -e

CABAL=${CABAL:-cabal}
HC=${HC:-ghc}

# Install cpphs if it is not in path
command -v cpphs || ${CABAL} v2-install --ignore-project --with-compiler "$HC" cpphs

# Regenerate quickcheck-hugs
sh make-hugs
find quickcheck-hugs

die() {
    echo "TEST FAILED"
    exit 1
}

dotest() {
  echo "$2" | hugs -98 -Pquickcheck-hugs: -p'> ' "$1" | tee hugs.output
  grep "$3" hugs.output || die
}

# Simple tests
dotest Test.QuickCheck 'quickCheck $ \xs -> reverse (reverse xs) === (xs :: [Int])' "OK, passed 100 tests."