diff --git a/test/expected-compile-failures/ChangeLog.md b/test/expected-compile-failures/ChangeLog.md deleted file mode 100644 index 12b97e7..0000000 --- a/test/expected-compile-failures/ChangeLog.md +++ /dev/null @@ -1,3 +0,0 @@ -# Changelog for expected-compile-failures - -## Unreleased changes diff --git a/test/expected-compile-failures/LICENSE b/test/expected-compile-failures/LICENSE deleted file mode 100644 index e037c72..0000000 --- a/test/expected-compile-failures/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright Author name here (c) 2018 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/expected-compile-failures/README.md b/test/expected-compile-failures/README.md index c44e534..b04a1cd 100644 --- a/test/expected-compile-failures/README.md +++ b/test/expected-compile-failures/README.md @@ -1 +1,6 @@ # expected-compile-failures + +This subdirectory contains a stack project for expected compilation failures. To +add a new "test case", create a new `executable` stanza in the `package.yaml` +file. The Travis CI test script ([`test.sh`](test.sh)) will attempt to compile +the executable and will exit with an error if it successfully compiled. diff --git a/test/expected-compile-failures/package.yaml b/test/expected-compile-failures/package.yaml index 97dcc27..f4f83e2 100644 --- a/test/expected-compile-failures/package.yaml +++ b/test/expected-compile-failures/package.yaml @@ -8,7 +8,6 @@ copyright: 2018 Matt Parsons extra-source-files: - README.md -- ChangeLog.md description: Please see the README on GitHub at diff --git a/test/expected-compile-failures/update-read-role/Main.hs b/test/expected-compile-failures/update-read-role/Main.hs index 149f58a..d4160f4 100644 --- a/test/expected-compile-failures/update-read-role/Main.hs +++ b/test/expected-compile-failures/update-read-role/Main.hs @@ -2,17 +2,16 @@ module Main where -import Control.Monad.IO.Class (MonadIO) -import Database.Persist.Sql (SqlWriteT) +import Control.Monad.IO.Class (MonadIO) import Database.Esqueleto - import Database.Esqueleto.Internal.Language (Insertion) +import Database.Persist.Sql (SqlWriteT) import Database.Persist.TH (mkDeleteCascade, mkMigrate, mkPersist, persistLowerCase, share, sqlSettings) -import Lib +import Lib main :: IO () main = pure () @@ -22,20 +21,5 @@ updateQuery = \p -> do set p [ PersonAge =. just (val 123) -. p ^. PersonBorn ] where_ $ isNothing (p ^. PersonAge) --- Currently gives the error: --- --- /home/matt/Projects/esqueleto/test/expected-compile-failures/update-read-role/Main.hs:26:14 --- : error: --- • Couldn't match type ‘backend’ with ‘SqlBackend’ --- arising from a use of ‘update’ --- ‘backend’ is a rigid type variable bound by --- the type signature for: --- shouldFail :: SqlReadT m () --- at update-read-role/Main.hs:26:1-31 --- • In the expression: update updateQuery --- In an equation for ‘shouldFail’: shouldFail = update updateQuery --- | --- 26 | shouldFail = update updateQuery --- | ^^^^^^^^^^^^^^^^^^ shouldFail :: MonadIO m => SqlReadT m () shouldFail = update updateQuery diff --git a/test/expected-compile-failures/write-read-role/Main.hs b/test/expected-compile-failures/write-read-role/Main.hs index ddefd92..bd8b7e8 100644 --- a/test/expected-compile-failures/write-read-role/Main.hs +++ b/test/expected-compile-failures/write-read-role/Main.hs @@ -2,17 +2,18 @@ module Main where -import Control.Monad.IO.Class (MonadIO) -import Database.Persist.Sql (SqlReadT) +import Control.Monad.IO.Class (MonadIO) import Database.Esqueleto (SqlExpr, SqlQuery, from, - val, (<#), insertSelect, (<&>), (^.)) + insertSelect, val, (<#), + (<&>), (^.)) import Database.Esqueleto.Internal.Language (Insertion) +import Database.Persist.Sql (SqlReadT) import Database.Persist.TH (mkDeleteCascade, mkMigrate, mkPersist, persistLowerCase, share, sqlSettings) -import Lib +import Lib main :: IO () main = pure ()