Skip to content

Commit

Permalink
Replace space in compilerSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Aug 14, 2024
1 parent 1fd95fe commit 591c40f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Test/SchemaCompilerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 591c40f

Please sign in to comment.