Skip to content

Commit 5deccaf

Browse files
vrom911Dmitrii Kovanikov
authored andcommitted
[#2] Add doctest (#6)
1 parent 27e7989 commit 5deccaf

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

postgresql-simple-named.cabal

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,14 @@ test-suite postgresql-simple-named-test
8181
build-depends: postgresql-simple-named
8282

8383
ghc-options: -threaded -rtsopts -with-rtsopts=-N
84+
85+
test-suite postgresql-simple-named-doctest
86+
import: common-options
87+
type: exitcode-stdio-1.0
88+
hs-source-dirs: test
89+
main-is: Doctest.hs
90+
91+
build-depends: doctest
92+
, Glob
93+
94+
ghc-options: -threaded

src/PgNamed.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ namesToRow names params = traverse magicLookup names
146146
{- | Operator to create 'NamedParam's.
147147
148148
>>> "foo" =? (1 :: Int)
149-
NamedParam {namedParamName = "foo", namedParamParam = 1}
149+
NamedParam {namedParamName = "foo", namedParamParam = Plain "1"}
150150
151151
So it can be used in creating the list of the named arguments:
152152

test/Doctest.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Main (main) where
2+
3+
import System.FilePath.Glob (glob)
4+
import Test.DocTest (doctest)
5+
6+
main :: IO ()
7+
main = do
8+
sourceFiles <- glob "src/**/*.hs"
9+
doctest
10+
$ "-XConstraintKinds"
11+
: "-XGeneralizedNewtypeDeriving"
12+
: "-XLambdaCase"
13+
: "-XOverloadedStrings"
14+
: "-XRecordWildCards"
15+
: "-XScopedTypeVariables"
16+
: sourceFiles

0 commit comments

Comments
 (0)