1module Bytea (testBytea) where
4import qualified Data.ByteString as B
6testBytea :: TestEnv -> Test
7testBytea TestEnv{..} = TestList
9 , testStr "\"hello\"" $ map (fromIntegral . fromEnum) ("hello" :: String)
10 , testStr "ascending" [0..255]
11 , testStr "descending" [255,254..0]
12 , testStr "ascending, doubled up" $ doubleUp [0..255]
13 , testStr "descending, doubled up" $ doubleUp [255,254..0]
16 testStr label bytes = TestLabel label $ TestCase $ do
19 [Only h] <- query conn "SELECT md5(?::bytea)" [Binary bs]
20 assertBool "Haskell -> SQL conversion altered the string" $ md5 bs == h
22 [Only (Binary r)] <- query conn "SELECT ?::bytea" [Binary bs]
23 assertBool "SQL -> Haskell conversion altered the string" $ bs == r
25 doubleUp = concatMap (\x -> [x, x])
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list