Skip to content

Commit

Permalink
Use base64 >= 3.1.0 for tests
Browse files Browse the repository at this point in the history
There were several breaking changes in this lib
  • Loading branch information
brendanlong committed Mar 1, 2019
1 parent 8346502 commit 03249c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pgx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ depends: [
"bisect_ppx" {build & >= "1.3.1"}
"dune" {build & >= "1.1.0"}

"base64" {test}
"ounit" {test}
"base64" {>= "3.1.0"}
"ounit"
]
5 changes: 3 additions & 2 deletions pgx_test/src/pgx_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,12 @@ module Make_tests (IO : Pgx.IO) = struct
; "binary string handling", (fun () ->
let all_chars = String.init 255 char_of_int in
with_conn (fun db ->
[ "SELECT decode($1, 'base64')", B64.encode all_chars, all_chars
[ "SELECT decode($1, 'base64')",
Base64.encode_string all_chars, all_chars
(* Postgres adds whitespace to base64 encodings, so we strip it
back out *)
; "SELECT regexp_replace(encode($1, 'base64'), '\\s', '', 'g')",
all_chars, B64.encode all_chars ]
all_chars, Base64.encode_string all_chars ]
|> deferred_list_map ~f:(fun (query, param, expect) ->
let params = [ param |> Pgx.Value.of_string ] in
execute ~params db query
Expand Down

0 comments on commit 03249c5

Please sign in to comment.