From 591c40f299dcb35211f764b83cd66d43de76eaf1 Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Wed, 14 Aug 2024 13:36:29 +0300 Subject: [PATCH] Replace space in compilerSpec --- Test/SchemaCompilerSpec.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Test/SchemaCompilerSpec.hs b/Test/SchemaCompilerSpec.hs index c80884f53..48d2363f6 100644 --- a/Test/SchemaCompilerSpec.hs +++ b/Test/SchemaCompilerSpec.hs @@ -184,12 +184,12 @@ tests = do } let compileOutput = compileStatementPreview [statement] statement |> Text.strip - compileOutput `shouldBe` [trimming| + compileOutput `shouldBe` ([trimming| data User' = User {id :: (Id' "users"), ids :: (Maybe [UUID]), electricityUnitPrice :: Double, meta :: MetaBag} deriving (Eq, Show) type instance PrimaryKey "users" = UUID - type User = User' + type User = User'U+0020 type instance GetTableName (User' ) = "users" type instance GetModelByTableName "users" = User @@ -246,6 +246,10 @@ tests = do builder |> QueryBuilder.filterWhere (#id, id) {-# INLINE filterWhereId #-} |] + -- Replace `U+0020` with a space. + |> Text.replace "U+0020" " ") + + it "should deal with integer default values for double columns" do let statement = StatementCreateTable CreateTable { name = "users" @@ -336,12 +340,12 @@ tests = do } let compileOutput = compileStatementPreview [statement] statement |> Text.strip - compileOutput `shouldBe` [trimming| + compileOutput `shouldBe` ([trimming| data User' = User {id :: (Id' "users"), ts :: (Maybe TSVector), meta :: MetaBag} deriving (Eq, Show) type instance PrimaryKey "users" = UUID - type User = User' + type User = User'U+0020 type instance GetTableName (User' ) = "users" type instance GetModelByTableName "users" = User @@ -397,6 +401,9 @@ tests = do builder |> QueryBuilder.filterWhere (#id, id) {-# INLINE filterWhereId #-} |] + -- Replace `U+0020` with a space. + |> Text.replace "U+0020" " ") + it "should deal with multiple has many relationships to the same table" do let statements = parseSqlStatements [trimming| CREATE TABLE landing_pages (