Commit a57cb83c authored by Andrew Gibiansky's avatar Andrew Gibiansky

Add a test that ensures that demo notebook doesnt change.

parent ca20e2a3
......@@ -4,7 +4,7 @@ env:
- DISPLAY=false RESOLVER=lts-2.22 # Last GHC 7.8 LTS
# Choose a lightweight base image; we provide our own build tools.
language: c
language: python
# Enable caching.
sudo: false
......@@ -49,6 +49,9 @@ before_install:
cd $OLDPWD
fi
# Install nbconvert for testing the notebook
- pip install jupyter notebook nbconvert
# This step takes the longest, and is what generates the Stack cache.
install:
# Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails.
......@@ -68,5 +71,14 @@ script:
stack build --resolver=$RESOLVER;
cd "$TOP";
done
# Ensure that IHaskell notebook remains unchanged.
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
stack install --stack-yaml=stack-full.yaml
stack exec -- ihaskell install --stack
stack exec -- jupyter nbconvert --to=notebook --execute --stdout notebooks/IHaskell.ipynb > ~/ihaskell-out.ipynb
# Images are rendered differently on different systems, so filter them out in the comparison
diff <(grep -v image/png ~/ihaskell-out.ipynb) <(grep -v image/png notebooks/IHaskell.ipynb)
fi
......@@ -162,15 +162,3 @@ testEval =
":typ 3" `becomes` ["3 :: forall a. Num a => a"]
":k Maybe" `becomes` ["Maybe :: * -> *"]
":in String" `pages` ["type String = [Char] \t-- Defined in \8216GHC.Base\8217"]
":info Monad" `pages` [ "class Applicative m => Monad (m :: * -> *) where"
, " (>>=) :: m a -> (a -> m b) -> m b"
, " (>>) :: m a -> m b -> m b"
, " return :: a -> m a"
, " fail :: String -> m a"
, " \t-- Defined in ‘GHC.Base’"
, "instance Monad (Either e) -- Defined in ‘Data.Either’"
, "instance Monad [] -- Defined in ‘GHC.Base’"
, "instance Monad Maybe -- Defined in ‘GHC.Base’"
, "instance Monad IO -- Defined in ‘GHC.Base’"
, "instance Monad ((->) r) -- Defined in ‘GHC.Base’"
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment