packages feed

persistent-test 2.13.1.3 → 2.13.1.4

raw patch · 37 files changed

+167/−109 lines, 37 filesdep ~persistentPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: persistent

API changes (from Hackage documentation)

- DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytes" (DataTypeTest.DataTypeTableGeneric backend) Data.ByteString.Internal.ByteString
- DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytesMaxLen" (DataTypeTest.DataTypeTableGeneric backend) Data.ByteString.Internal.ByteString
- DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytesTextTuple" (DataTypeTest.DataTypeTableGeneric backend) (DataTypeTest.Tuple Data.ByteString.Internal.ByteString Data.Text.Internal.Text)
- Init: UnliftIO :: (forall a. () => m a -> IO a) -> UnliftIO (m :: Type -> Type)
- Init: [unliftIO] :: UnliftIO (m :: Type -> Type) -> forall a. () => m a -> IO a
- Init: askRunInIO :: MonadUnliftIO m => m (m a -> IO a)
- Init: askUnliftIO :: MonadUnliftIO m => m (UnliftIO m)
- Init: class Monad m => MonadIO (m :: Type -> Type)
- Init: class MonadIO m => MonadUnliftIO (m :: Type -> Type)
- Init: liftIO :: MonadIO m => IO a -> m a
- Init: newtype UnliftIO (m :: Type -> Type)
- Init: toIO :: MonadUnliftIO m => m a -> m (IO a)
- Init: withRunInIO :: MonadUnliftIO m => ((forall a. () => m a -> IO a) -> IO b) -> m b
- Init: withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a
- Init: wrappedWithRunInIO :: MonadUnliftIO n => (n b -> m b) -> (forall a. () => m a -> n a) -> ((forall a. () => m a -> IO a) -> IO b) -> m b
- MaxLenTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bs1" (MaxLenTest.MaxLenGeneric backend) Data.ByteString.Internal.ByteString
- MaxLenTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bs2" (MaxLenTest.MaxLenGeneric backend) Data.ByteString.Internal.ByteString
- RenameTest: instance ((TypeError ...), Database.Persist.Class.PersistStore.PersistStoreWrite backend) => Database.Persist.Class.PersistEntity.SafeToInsert (RenameTest.LowerCaseTableGeneric backend)
+ CompositeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" CompositeTest.CitizenAddress (Database.Persist.Class.PersistEntity.Key CompositeTest.CitizenAddress)
+ CompositeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" CompositeTest.PrimaryCompositeWithOtherNullableFields (Database.Persist.Class.PersistEntity.Key CompositeTest.PrimaryCompositeWithOtherNullableFields)
+ CompositeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" CompositeTest.TestParent (Database.Persist.Class.PersistEntity.Key CompositeTest.TestParent)
+ CustomPrimaryKeyReferenceTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" CustomPrimaryKeyReferenceTest.Tweet (Database.Persist.Class.PersistEntity.Key CustomPrimaryKeyReferenceTest.Tweet)
+ DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytes" (DataTypeTest.DataTypeTableGeneric backend) Data.ByteString.Internal.Type.ByteString
+ DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytesMaxLen" (DataTypeTest.DataTypeTableGeneric backend) Data.ByteString.Internal.Type.ByteString
+ DataTypeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bytesTextTuple" (DataTypeTest.DataTypeTableGeneric backend) (DataTypeTest.Tuple Data.ByteString.Internal.Type.ByteString Data.Text.Internal.Text)
+ ForeignKey: instance Database.Persist.Class.PersistEntity.SymbolToField "id" ForeignKey.Parent (Database.Persist.Class.PersistEntity.Key ForeignKey.Parent)
+ ForeignKey: instance Database.Persist.Class.PersistEntity.SymbolToField "id" ForeignKey.ParentComposite (Database.Persist.Class.PersistEntity.Key ForeignKey.ParentComposite)
+ ForeignKey: instance Database.Persist.Class.PersistEntity.SymbolToField "id" ForeignKey.SelfReferenced (Database.Persist.Class.PersistEntity.Key ForeignKey.SelfReferenced)
+ MaxLenTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bs1" (MaxLenTest.MaxLenGeneric backend) Data.ByteString.Internal.Type.ByteString
+ MaxLenTest: instance Database.Persist.Class.PersistEntity.SymbolToField "bs2" (MaxLenTest.MaxLenGeneric backend) Data.ByteString.Internal.Type.ByteString
+ MigrationTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" MigrationTest.CustomSqlId (Database.Persist.Class.PersistEntity.Key MigrationTest.CustomSqlId)
+ PersistUniqueTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PersistUniqueTest.Fo (Database.Persist.Class.PersistEntity.Key PersistUniqueTest.Fo)
+ PersistUniqueTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PersistUniqueTest.OnlyPrimaryKey (Database.Persist.Class.PersistEntity.Key PersistUniqueTest.OnlyPrimaryKey)
+ PersistentTestModels: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PersistentTestModels.Tree (Database.Persist.Class.PersistEntity.Key PersistentTestModels.Tree)
+ PrimaryTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PrimaryTest.CompositePrimary (Database.Persist.Class.PersistEntity.Key PrimaryTest.CompositePrimary)
+ PrimaryTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PrimaryTest.Foo (Database.Persist.Class.PersistEntity.Key PrimaryTest.Foo)
+ PrimaryTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" PrimaryTest.Trees (Database.Persist.Class.PersistEntity.Key PrimaryTest.Trees)
+ RenameTest: instance Database.Persist.Class.PersistStore.PersistStoreWrite backend => Database.Persist.Class.PersistEntity.SafeToInsert (RenameTest.LowerCaseTableGeneric backend)
+ TransactionLevelTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" TransactionLevelTest.Wombat (Database.Persist.Class.PersistEntity.Key TransactionLevelTest.Wombat)
+ TreeTest: instance Database.Persist.Class.PersistEntity.SymbolToField "id" TreeTest.Tree (Database.Persist.Class.PersistEntity.Key TreeTest.Tree)
- CompositeTest: cleanDB :: (PersistQuery backend, PersistEntityBackend TestChild ~ backend, MonadIO m) => ReaderT backend m ()
+ CompositeTest: cleanDB :: forall backend (m :: Type -> Type). (PersistQuery backend, PersistEntityBackend TestChild ~ backend, MonadIO m) => ReaderT backend m ()
- CompositeTest: specsWith :: (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
+ CompositeTest: specsWith :: forall (m :: Type -> Type). (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
- CustomPersistFieldTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ CustomPersistFieldTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- CustomPrimaryKeyReferenceTest: cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend Tweet ~ backend) => ReaderT backend m ()
+ CustomPrimaryKeyReferenceTest: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistEntityBackend Tweet ~ backend) => ReaderT backend m ()
- CustomPrimaryKeyReferenceTest: specsWith :: (MonadFail m, MonadIO m) => RunDb SqlBackend m -> Spec
+ CustomPrimaryKeyReferenceTest: specsWith :: forall (m :: Type -> Type). (MonadFail m, MonadIO m) => RunDb SqlBackend m -> Spec
- DataTypeTest: specsWith :: forall db backend m entity. (db ~ ReaderT backend m, PersistStoreRead backend, PersistEntity entity, PersistEntityBackend entity ~ BaseBackend backend, Arbitrary entity, PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), PersistQueryWrite (BaseBackend backend), PersistQueryWrite backend, MonadFail m, MonadIO m, SafeToInsert entity) => (db () -> IO ()) -> Maybe (db [Text]) -> [TestFn entity] -> [(String, entity -> Pico)] -> (entity -> Double) -> Spec
+ DataTypeTest: specsWith :: forall db backend (m :: Type -> Type) entity. (db ~ ReaderT backend m, PersistStoreRead backend, PersistEntity entity, PersistEntityBackend entity ~ BaseBackend backend, Arbitrary entity, PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), PersistQueryWrite (BaseBackend backend), PersistQueryWrite backend, MonadFail m, MonadIO m, SafeToInsert entity) => (db () -> IO ()) -> Maybe (db [Text]) -> [TestFn entity] -> [(String, entity -> Pico)] -> (entity -> Double) -> Spec
- EmbedOrderTest: cleanDB :: Runner backend m => ReaderT backend m ()
+ EmbedOrderTest: cleanDB :: forall backend (m :: Type -> Type). Runner backend m => ReaderT backend m ()
- EmbedOrderTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ EmbedOrderTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- EmbedTest: cleanDB :: (PersistQuery backend, PersistEntityBackend HasMap ~ backend, MonadIO m) => ReaderT backend m ()
+ EmbedTest: cleanDB :: forall backend (m :: Type -> Type). (PersistQuery backend, PersistEntityBackend HasMap ~ backend, MonadIO m) => ReaderT backend m ()
- EmbedTest: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ EmbedTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- EmptyEntityTest: cleanDB :: (PersistQueryWrite backend, MonadIO m, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
+ EmptyEntityTest: cleanDB :: forall backend (m :: Type -> Type). (PersistQueryWrite backend, MonadIO m, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
- EmptyEntityTest: specsWith :: Runner backend m => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
+ EmptyEntityTest: specsWith :: forall backend (m :: Type -> Type) a. Runner backend m => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
- EquivalentTypeTest: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ EquivalentTypeTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- ForeignKey: cleanDB :: MonadIO m => SqlPersistT m ()
+ ForeignKey: cleanDB :: forall (m :: Type -> Type). MonadIO m => SqlPersistT m ()
- ForeignKey: del :: forall a m. (PersistEntity a, PersistEntityBackend a ~ SqlBackend, MonadIO m) => SqlPersistT m ()
+ ForeignKey: del :: forall a (m :: Type -> Type). (PersistEntity a, PersistEntityBackend a ~ SqlBackend, MonadIO m) => SqlPersistT m ()
- ForeignKey: specsWith :: (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
+ ForeignKey: specsWith :: forall (m :: Type -> Type). (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
- GeneratedColumnTestSQL: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ GeneratedColumnTestSQL: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- HtmlTest: cleanDB :: Runner backend m => ReaderT backend m ()
+ HtmlTest: cleanDB :: forall backend (m :: Type -> Type). Runner backend m => ReaderT backend m ()
- HtmlTest: specsWith :: Runner backend m => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
+ HtmlTest: specsWith :: forall backend (m :: Type -> Type) a. Runner backend m => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
- Init: [TestFn] :: (Show a, Eq a) => String -> (entity -> a) -> TestFn entity
+ Init: [TestFn] :: forall a entity. (Show a, Eq a) => String -> (entity -> a) -> TestFn entity
- Init: changeBackend :: forall backend backend' m. MonadUnliftIO m => (backend -> backend') -> RunDb backend m -> RunDb backend' m
+ Init: changeBackend :: forall backend backend' (m :: Type -> Type). MonadUnliftIO m => (backend -> backend') -> RunDb backend m -> RunDb backend' m
- Init: infix 1 @=?
+ Init: infix 1 @?=
- Init: type RunDb backend m = ReaderT backend m () -> IO ()
+ Init: type RunDb backend (m :: Type -> Type) = ReaderT backend m () -> IO ()
- Init: type Runner backend m = (MonadIO m, MonadUnliftIO m, MonadFail m, MonadThrow m, MonadBaseControl IO m, PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), GenerateKey backend, HasPersistBackend backend, PersistUniqueWrite backend, PersistQueryWrite backend, backend ~ BaseBackend backend, PersistQueryRead backend)
+ Init: type Runner backend (m :: Type -> Type) = (MonadIO m, MonadUnliftIO m, MonadFail m, MonadThrow m, MonadBaseControl IO m, PersistStoreWrite backend, PersistStoreWrite BaseBackend backend, GenerateKey backend, HasPersistBackend backend, PersistUniqueWrite backend, PersistQueryWrite backend, backend ~ BaseBackend backend, PersistQueryRead backend)
- LargeNumberTest: cleanDB :: Runner backend m => ReaderT backend m ()
+ LargeNumberTest: cleanDB :: forall backend (m :: Type -> Type). Runner backend m => ReaderT backend m ()
- LargeNumberTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ LargeNumberTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- LongIdentifierTest: specsWith :: MonadIO m => RunDb SqlBackend m -> Spec
+ LongIdentifierTest: specsWith :: forall (m :: Type -> Type). MonadIO m => RunDb SqlBackend m -> Spec
- MaxLenTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ MaxLenTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- MaybeFieldDefsTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ MaybeFieldDefsTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- MigrationColumnLengthTest: specsWith :: MonadIO m => RunDb SqlBackend m -> Spec
+ MigrationColumnLengthTest: specsWith :: forall (m :: Type -> Type). MonadIO m => RunDb SqlBackend m -> Spec
- MigrationIdempotencyTest: specsWith :: MonadIO m => RunDb SqlBackend m -> Spec
+ MigrationIdempotencyTest: specsWith :: forall (m :: Type -> Type). MonadIO m => RunDb SqlBackend m -> Spec
- MigrationOnlyTest: specsWith :: (MonadIO m, PersistQueryWrite backend, PersistStoreWrite backend, PersistQueryWrite (BaseBackend backend)) => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
+ MigrationOnlyTest: specsWith :: forall (m :: Type -> Type) backend a. (MonadIO m, PersistQueryWrite backend, PersistStoreWrite backend, PersistQueryWrite (BaseBackend backend)) => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
- MigrationTest: specsWith :: MonadUnliftIO m => RunDb SqlBackend m -> Spec
+ MigrationTest: specsWith :: forall (m :: Type -> Type). MonadUnliftIO m => RunDb SqlBackend m -> Spec
- MpsCustomPrefixTest: specsWith :: MonadIO m => RunDb SqlBackend m -> Spec
+ MpsCustomPrefixTest: specsWith :: forall (m :: Type -> Type). MonadIO m => RunDb SqlBackend m -> Spec
- MpsNoPrefixTest: specsWith :: MonadIO m => RunDb SqlBackend m -> Spec
+ MpsNoPrefixTest: specsWith :: forall (m :: Type -> Type). MonadIO m => RunDb SqlBackend m -> Spec
- PersistUniqueTest: cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend Fo ~ backend) => ReaderT backend m ()
+ PersistUniqueTest: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistEntityBackend Fo ~ backend) => ReaderT backend m ()
- PersistUniqueTest: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ PersistUniqueTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- PersistentTest: _polymorphic :: (MonadFail m, MonadIO m, PersistQuery backend, BaseBackend backend ~ PersistEntityBackend Pet) => ReaderT backend m ()
+ PersistentTest: _polymorphic :: forall (m :: Type -> Type) backend. (MonadFail m, MonadIO m, PersistQuery backend, BaseBackend backend ~ PersistEntityBackend Pet) => ReaderT backend m ()
- PersistentTest: cleanDB :: (MonadIO m, PersistQuery backend, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
+ PersistentTest: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
- PersistentTest: filterOrSpecs :: forall m backend. Runner backend m => RunDb backend m -> Spec
+ PersistentTest: filterOrSpecs :: forall (m :: Type -> Type) backend. Runner backend m => RunDb backend m -> Spec
- PersistentTest: safeToRemoveSpec :: forall backend m. Runner backend m => RunDb backend m -> Spec
+ PersistentTest: safeToRemoveSpec :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- PersistentTest: specsWith :: forall backend m. Runner backend m => RunDb backend m -> Spec
+ PersistentTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- PersistentTest: type ASetter s t a b = (a -> Identity b) -> s -> Identity t
+ PersistentTest: type ASetter s t a b = a -> Identity b -> s -> Identity t
- PersistentTest: type Getting r s t a b = (a -> Constant r b) -> s -> Constant r t
+ PersistentTest: type Getting r s t a b = a -> Constant r b -> s -> Constant r t
- PersistentTestModels: cleanDB :: (MonadIO m, PersistQuery backend, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
+ PersistentTestModels: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistStoreWrite (BaseBackend backend)) => ReaderT backend m ()
- PrimaryTest: cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend Foo ~ backend) => ReaderT backend m ()
+ PrimaryTest: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistEntityBackend Foo ~ backend) => ReaderT backend m ()
- PrimaryTest: specsWith :: (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
+ PrimaryTest: specsWith :: forall (m :: Type -> Type). (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
- RawSqlTest: caseCommitRollback :: Runner SqlBackend m => RunDb SqlBackend m -> Assertion
+ RawSqlTest: caseCommitRollback :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Assertion
- RawSqlTest: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ RawSqlTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- ReadWriteTest: specsWith :: forall m. Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ ReadWriteTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- Recursive: specsWith :: (PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), MonadIO m) => RunDb backend m -> Spec
+ Recursive: specsWith :: forall backend (m :: Type -> Type). (PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), MonadIO m) => RunDb backend m -> Spec
- RenameTest: cleanDB :: forall backend. (BaseBackend backend ~ backend, PersistQueryWrite backend) => ReaderT backend IO ()
+ RenameTest: cleanDB :: (BaseBackend backend ~ backend, PersistQueryWrite backend) => ReaderT backend IO ()
- RenameTest: specsWith :: (PersistStoreWrite backend, PersistQueryRead backend, backend ~ BaseBackend backend, MonadIO m, MonadFail m, Eq (BackendKey backend)) => RunDb backend m -> Spec
+ RenameTest: specsWith :: forall backend (m :: Type -> Type). (PersistStoreWrite backend, PersistQueryRead backend, backend ~ BaseBackend backend, MonadIO m, MonadFail m, Eq (BackendKey backend)) => RunDb backend m -> Spec
- SumTypeTest: specsWith :: (PersistQueryWrite backend, BaseBackend backend ~ backend, MonadIO m, MonadFail m) => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
+ SumTypeTest: specsWith :: forall backend (m :: Type -> Type) a. (PersistQueryWrite backend, BaseBackend backend ~ backend, MonadIO m, MonadFail m) => RunDb backend m -> Maybe (ReaderT backend m a) -> Spec
- TransactionLevelTest: specsWith :: (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
+ TransactionLevelTest: specsWith :: forall (m :: Type -> Type). (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
- TreeTest: cleanDB :: (PersistQuery backend, PersistEntityBackend Tree ~ backend, MonadIO m) => ReaderT backend m ()
+ TreeTest: cleanDB :: forall backend (m :: Type -> Type). (PersistQuery backend, PersistEntityBackend Tree ~ backend, MonadIO m) => ReaderT backend m ()
- TreeTest: specsWith :: (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
+ TreeTest: specsWith :: forall (m :: Type -> Type). (MonadIO m, MonadFail m) => RunDb SqlBackend m -> Spec
- TypeLitFieldDefsTest: specsWith :: Runner backend m => RunDb backend m -> Spec
+ TypeLitFieldDefsTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> Spec
- UniqueTest: cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend TestNonNull ~ backend) => ReaderT backend m ()
+ UniqueTest: cleanDB :: forall (m :: Type -> Type) backend. (MonadIO m, PersistQuery backend, PersistEntityBackend TestNonNull ~ backend) => ReaderT backend m ()
- UniqueTest: specsWith :: Runner SqlBackend m => RunDb SqlBackend m -> Spec
+ UniqueTest: specsWith :: forall (m :: Type -> Type). Runner SqlBackend m => RunDb SqlBackend m -> Spec
- UpsertTest: specsWith :: forall backend m. Runner backend m => RunDb backend m -> BackendNullUpdateBehavior -> BackendUpsertKeyBehavior -> Spec
+ UpsertTest: specsWith :: forall backend (m :: Type -> Type). Runner backend m => RunDb backend m -> BackendNullUpdateBehavior -> BackendUpsertKeyBehavior -> Spec

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ ## Unreleased changes +## 2.13.1.4++* Support `persistent-2.17`+ ## 2.13.1.3  * Support persistent-2.14 with `SafeToInsert` class
persistent-test.cabal view
@@ -1,109 +1,110 @@-name:            persistent-test-version:         2.13.1.3-license:         MIT-license-file:    LICENSE-author:          Michael Snoyman <michael@snoyman.com>-maintainer:      Michael Snoyman <michael@snoyman.com>-synopsis:        Tests for Persistent-description:     Tests for Persistent. This is only for use in developing libraries that should conform to the persistent interface, not for users of the persistent suite of database libraries.-category:        Database, Yesod-stability:       Stable-cabal-version:   >= 1.10-build-type:      Simple-homepage:        http://www.yesodweb.com/book/persistent-bug-reports:     https://github.com/yesodweb/persistent/issues+name:               persistent-test+version:            2.13.1.4+license:            MIT+license-file:       LICENSE+author:             Michael Snoyman <michael@snoyman.com>+maintainer:         Michael Snoyman <michael@snoyman.com>+synopsis:           Tests for Persistent+description:+  Tests for Persistent. This is only for use in developing libraries that should conform to the persistent interface, not for users of the persistent suite of database libraries.++category:           Database, Yesod+stability:          Stable+cabal-version:      >=1.10+build-type:         Simple+homepage:           http://www.yesodweb.com/book/persistent+bug-reports:        https://github.com/yesodweb/persistent/issues extra-source-files: ChangeLog.md  library-    exposed-modules: -        CompositeTest-        CustomPersistField-        CustomPersistFieldTest-        CustomPrimaryKeyReferenceTest-        DataTypeTest-        EmbedTest-        EmbedOrderTest-        EmptyEntityTest-        EntityEmbedTest-        EquivalentTypeTest-        ForeignKey-        HtmlTest-        Init-        LargeNumberTest-        MaxLenTest-        MaybeFieldDefsTest-        MigrationColumnLengthTest-        MigrationIdempotencyTest-        MigrationOnlyTest-        MigrationTest-        MpsNoPrefixTest-        MpsCustomPrefixTest-        PersistentTest-        PersistentTestModels-        PersistentTestModelsImports-        GeneratedColumnTestSQL-        PersistTestPetType-        PersistTestPetCollarType-        PersistUniqueTest-        PrimaryTest-        RawSqlTest-        ReadWriteTest-        RenameTest-        Recursive-        SumTypeTest-        TransactionLevelTest-        TreeTest-        TypeLitFieldDefsTest-        UniqueTest-        UpsertTest-        LongIdentifierTest--    hs-source-dirs: src+  exposed-modules:+    CompositeTest+    CustomPersistField+    CustomPersistFieldTest+    CustomPrimaryKeyReferenceTest+    DataTypeTest+    EmbedOrderTest+    EmbedTest+    EmptyEntityTest+    EntityEmbedTest+    EquivalentTypeTest+    ForeignKey+    GeneratedColumnTestSQL+    HtmlTest+    Init+    LargeNumberTest+    LongIdentifierTest+    MaxLenTest+    MaybeFieldDefsTest+    MigrationColumnLengthTest+    MigrationIdempotencyTest+    MigrationOnlyTest+    MigrationTest+    MpsCustomPrefixTest+    MpsNoPrefixTest+    PersistentTest+    PersistentTestModels+    PersistentTestModelsImports+    PersistTestPetCollarType+    PersistTestPetType+    PersistUniqueTest+    PrimaryTest+    RawSqlTest+    ReadWriteTest+    Recursive+    RenameTest+    SumTypeTest+    TransactionLevelTest+    TreeTest+    TypeLitFieldDefsTest+    UniqueTest+    UpsertTest -    build-depends: -        base                     >= 4.9       && < 5-      , aeson                    >= 1.0-      , blaze-html               >= 0.9-      , bytestring               >= 0.10-      , conduit                  >= 1.2.12-      , containers               >= 0.5-      , exceptions               >= 0.8-      , hspec                    >= 2.4-      , hspec-expectations-      , http-api-data-      , HUnit-      , monad-control-      , monad-logger             >= 0.3.25-      , mtl-      , path-pieces              >= 0.2-      , persistent               >= 2.14        && < 2.15-      , QuickCheck               >= 2.9-      , quickcheck-instances     >= 0.3-      , random                   >= 1.1-      , resourcet                >= 1.1-      , text                     >= 1.2-      , time                     >= 1.6-      , transformers             >= 0.5-      , transformers-base-      , unliftio-      , unliftio-core-      , unordered-containers+  hs-source-dirs:     src+  build-depends:+      aeson                 >=1.0+    , base                  >=4.9    && <5+    , blaze-html            >=0.9+    , bytestring            >=0.10+    , conduit               >=1.2.12+    , containers            >=0.5+    , exceptions            >=0.8+    , hspec                 >=2.4+    , hspec-expectations+    , http-api-data+    , HUnit+    , monad-control+    , monad-logger          >=0.3.25+    , mtl+    , path-pieces           >=0.2+    , persistent            >=2.14   && <2.18+    , QuickCheck            >=2.9+    , quickcheck-instances  >=0.3+    , random                >=1.1+    , resourcet             >=1.1+    , text                  >=1.2+    , time                  >=1.6+    , transformers          >=0.5+    , transformers-base+    , unliftio+    , unliftio-core+    , unordered-containers -  default-language: Haskell2010+  default-language:   Haskell2010   default-extensions:-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances-      MultiParamTypeClasses-      OverloadedStrings-      QuasiQuotes-      TemplateHaskell-      TypeFamilies-      StandaloneDeriving-      DerivingStrategies-      GeneralizedNewtypeDeriving-      DataKinds+    DataKinds+    DerivingStrategies+    ExistentialQuantification+    FlexibleContexts+    FlexibleInstances+    GeneralizedNewtypeDeriving+    MultiParamTypeClasses+    OverloadedStrings+    QuasiQuotes+    StandaloneDeriving+    TemplateHaskell+    TypeFamilies  source-repository head   type:     git-  location: git://github.com/yesodweb/persistent.git+  location: https://github.com/yesodweb/persistent.git
src/CompositeTest.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- FIXME {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} module CompositeTest where
src/CustomPersistFieldTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module CustomPersistFieldTest (specsWith, customFieldMigrate) where 
src/CustomPrimaryKeyReferenceTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- This test is based on this issue: https://github.com/yesodweb/persistent/issues/421 -- The primary thing this is testing is the migration, thus the test code itself being mostly negligible.
src/DataTypeTest.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module DataTypeTest     ( specsWith@@ -116,10 +117,10 @@             key <- insert x             Just y <- get key             liftIO $ do-                let check :: (Eq a, Show a) => String -> (entity -> a) -> IO ()+                let check :: (Eq a, Show a, HasCallStack) => String -> (entity -> a) -> IO ()                     check s f = (s, f x) @=? (s, f y)                 -- Check floating-point near equality-                let check' :: (Fractional p, Show p, Real p) => String -> (entity -> p) -> IO ()+                let check' :: (Fractional p, Show p, Real p, HasCallStack) => String -> (entity -> p) -> IO ()                     check' s f                         | abs (f x - f y) < 0.000001 = return ()                         | otherwise = (s, f x) @=? (s, f y)
src/EmbedOrderTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module EmbedOrderTest (specsWith, embedOrderMigrate, cleanDB) where
src/EmbedTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans -O0 #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module EmbedTest (specsWith, cleanDB, embedMigrate) where
src/EmptyEntityTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module EmptyEntityTest (specsWith, migration, cleanDB) where 
src/EntityEmbedTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} module EntityEmbedTest where  -- because we are using a type alias we need to declare in a separate module
src/EquivalentTypeTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} 
src/ForeignKey.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE AllowAmbiguousTypes, GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables, TypeApplications, UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-}  module ForeignKey where 
src/GeneratedColumnTestSQL.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module GeneratedColumnTestSQL (specsWith) where
src/HtmlTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module HtmlTest (specsWith, cleanDB, htmlMigrate) where 
src/Init.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} 
src/LargeNumberTest.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module LargeNumberTest where 
src/LongIdentifierTest.hs view
@@ -9,6 +9,7 @@ {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module LongIdentifierTest where 
src/MaxLenTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-}  module MaxLenTest (specsWith, maxlenMigrate) where
src/MaybeFieldDefsTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} 
src/MigrationColumnLengthTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module MigrationColumnLengthTest where 
src/MigrationIdempotencyTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module MigrationIdempotencyTest where 
src/MigrationOnlyTest.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeApplications, UndecidableInstances #-}+{-# LANGUAGE TypeApplications, TypeOperators, UndecidableInstances #-}  {-# OPTIONS_GHC -Wno-unused-top-binds #-} 
src/MigrationTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module MigrationTest where 
src/PersistUniqueTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module PersistUniqueTest where @@ -50,6 +51,18 @@             Just vk <- get k             Just vu <- getBy (UniqueBar b)             vu @== Entity k vk++    describe "existsBy" $ do+        it "works to query the existence of a record in the database" $ runDb $ do+            let b = 5+            k <- insert Fo { foFoo = 3, foBar = b }+            result <- existsBy $ UniqueBar b+            result @== True++        it "returns false for nonexistent records" $ runDb $ do+            insert_ Fo { foFoo = 3, foBar = 5 }+            result <- existsBy $ UniqueBar 17+            result @== False      describe "insertUniqueEntity" $ do         it "inserts a value if no conflicts are present" $ runDb $ do
src/PersistentTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE RecordWildCards, UndecidableInstances #-}  module PersistentTest@@ -650,7 +651,7 @@     it "provides comments on entity def" $ do       getEntityComments edef         `shouldBe`-          Just "This is a doc comment for a relationship.\nYou need to put the pipe character for each line of documentation.\nBut you can resume the doc comments afterwards.\n"+          Just "This is a doc comment for a relationship.\nOnly the first line requires a pipe.\nPipes are optional on subsequent lines.\n"     it "provides comments on the field" $ do       let [nameField, _] = getEntityFields edef       fieldComments nameField
src/PersistentTestModels.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- FIXME  {-# OPTIONS_GHC -ddump-splices #-}@@ -109,9 +110,8 @@     deriving Eq Show    -- | This is a doc comment for a relationship.-  -- | You need to put the pipe character for each line of documentation.-  -- Lines without a pipe are omitted.-  -- | But you can resume the doc comments afterwards.+  -- Only the first line requires a pipe.+  -- | Pipes are optional on subsequent lines.   Relationship       -- | Fields should be documentable.       name String
src/PersistentTestModelsImports.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE TypeOperators #-} {-# language UndecidableInstances #-}  -- | this just needs to compile
src/PrimaryTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE DeriveGeneric #-} 
src/RawSqlTest.hs view
@@ -1,4 +1,5 @@ {-# language ScopedTypeVariables, DataKinds #-}+{-# LANGUAGE TypeOperators #-}  module RawSqlTest where 
src/ReadWriteTest.hs view
@@ -53,3 +53,14 @@                 mkey1 @== Nothing                 mperson <- selectFirst [PersonName ==. name_] []                 fmap entityVal mperson @== Just person++                let nameLuke = "Luke Seale New"+                    personLuke = Person nameLuke 31 Nothing+                mkey2 <- insertUnique_ personLuke+                mkey3 <- insertUnique_ personLuke+                mkey3 @== Nothing+                mpersonLuke <- selectFirst [PersonName ==. nameLuke] []+                fmap entityVal mpersonLuke @== Just personLuke+++
src/Recursive.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-}  {-# OPTIONS_GHC -Wno-unused-top-binds #-} 
src/RenameTest.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeApplications, UndecidableInstances #-}+{-# LANGUAGE TypeApplications, TypeOperators, UndecidableInstances #-}  module RenameTest where 
src/SumTypeTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} module SumTypeTest (specsWith, sumTypeMigrate) where
src/TransactionLevelTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}  module TransactionLevelTest where
src/TreeTest.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE RecordWildCards, UndecidableInstances #-}+{-# LANGUAGE RecordWildCards, TypeOperators, UndecidableInstances #-}  module TreeTest where 
src/TypeLitFieldDefsTest.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-unused-top-binds #-} 
src/UniqueTest.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module UniqueTest where