@@ -26,6 +26,7 @@ import Control.Concurrent
2626import qualified Data.Set as S
2727import Data.Text hiding (map)
2828import qualified Data.Text as T
29+import Data.Time.Clock.POSIX
2930
3031main :: IO ()
3132main = do
@@ -123,7 +124,9 @@ main = do
123124 ("x:=relation{tuple{a Just 3}}", mkRelationFromList simpleMaybeIntAttributes [[ConstructedAtom "Just" maybeIntAtomType [IntAtom 3]]]),
124125 --test Either Int Text
125126 ("x:=relation{tuple{a Left 3}}", Left (TypeConstructorTypeVarsMismatch (S.fromList ["a","b"]) (S.fromList ["a"]))), -- Left 3, alone is not enough information to imply the type
126− ("x:=relation{a Either Int Text}{tuple{a Left 3}}", mkRelationFromList simpleEitherIntTextAttributes [[ConstructedAtom "Left" (eitherAtomType IntAtomType TextAtomType) [IntAtom 3]]])
127+ ("x:=relation{a Either Int Text}{tuple{a Left 3}}", mkRelationFromList simpleEitherIntTextAttributes [[ConstructedAtom "Left" (eitherAtomType IntAtomType TextAtomType) [IntAtom 3]]]),
128+ --test datetime constructor
129+ ("x:=relation{tuple{a dateTimeFromEpochSeconds(1495199790)}}", mkRelationFromList (A.attributesFromList [Attribute "a" DateTimeAtomType]) [[DateTimeAtom (posixSecondsToUTCTime(realToFrac 1495199790))]])
127130 ]
128131
129132assertTutdEqual :: DatabaseContext -> Either RelationalError Relation -> Text -> Assertion