Skip to content

Commit

Permalink
Fix with-test annotations and require base64 < 3.0.0
Browse files Browse the repository at this point in the history
In opam 2.0, {test} should be {with-test}

We need base64 < 3.0, because the latest version is incompatible
with core-extended:

https://discuss.ocaml.org/t/what-to-do-about-files-both-define-module-base64/3426
  • Loading branch information
brendanlong committed Jul 8, 2019
1 parent f87475d commit 10e6edb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pgx.opam
Expand Up @@ -21,6 +21,6 @@ depends: [
"bisect_ppx" {build & >= "1.3.1"}
"dune" {build & >= "1.1.0"}

"base64" {>= "3.1.0"}
"ounit"
"base64" {with-test & < "3.0.0"}
"ounit" {with-test}
]
5 changes: 2 additions & 3 deletions pgx_test/src/pgx_test.ml
Expand Up @@ -455,12 +455,11 @@ 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')",
Base64.encode_string all_chars, all_chars
[ "SELECT decode($1, 'base64')", B64.encode 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, Base64.encode_string all_chars ]
all_chars, B64.encode 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 10e6edb

Please sign in to comment.