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: ...@@ -4,7 +4,7 @@ env:
- DISPLAY=false RESOLVER=lts-2.22 # Last GHC 7.8 LTS - DISPLAY=false RESOLVER=lts-2.22 # Last GHC 7.8 LTS
# Choose a lightweight base image; we provide our own build tools. # Choose a lightweight base image; we provide our own build tools.
language: c language: python
# Enable caching. # Enable caching.
sudo: false sudo: false
...@@ -49,6 +49,9 @@ before_install: ...@@ -49,6 +49,9 @@ before_install:
cd $OLDPWD cd $OLDPWD
fi fi
# Install nbconvert for testing the notebook
- pip install jupyter notebook nbconvert
# This step takes the longest, and is what generates the Stack cache. # This step takes the longest, and is what generates the Stack cache.
install: install:
# Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails. # Set path for pkg-config to find zeromq, otherwise install of zeromq4-haskell fails.
...@@ -68,5 +71,14 @@ script: ...@@ -68,5 +71,14 @@ script:
stack build --resolver=$RESOLVER; stack build --resolver=$RESOLVER;
cd "$TOP"; cd "$TOP";
done 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 fi
...@@ -162,15 +162,3 @@ testEval = ...@@ -162,15 +162,3 @@ testEval =
":typ 3" `becomes` ["3 :: forall a. Num a => a"] ":typ 3" `becomes` ["3 :: forall a. Num a => a"]
":k Maybe" `becomes` ["Maybe :: * -> *"] ":k Maybe" `becomes` ["Maybe :: * -> *"]
":in String" `pages` ["type String = [Char] \t-- Defined in \8216GHC.Base\8217"] ":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