Clean up the test project

This commit is contained in:
parsonsmatt 2018-12-19 09:54:14 -07:00
parent 01604be570
commit cecebcd2ec
6 changed files with 13 additions and 57 deletions

View File

@ -1,3 +0,0 @@
# Changelog for expected-compile-failures
## Unreleased changes

View File

@ -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.

View File

@ -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.

View File

@ -8,7 +8,6 @@ copyright: 2018 Matt Parsons
extra-source-files:
- README.md
- ChangeLog.md
description: Please see the README on GitHub at <https://github.com/bitemyapp/esqueleto/test/expected-compile-failures#readme>

View File

@ -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

View File

@ -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 ()