Skip to content

Commit

Permalink
Fix tests on OCaml 4.06
Browse files Browse the repository at this point in the history
  • Loading branch information
alavrik committed Feb 13, 2018
1 parent 336e8fd commit 7334da1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/custom-types/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SOURCES = \


export OCAMLPATH := ../..:$(OCAMLPATH)
PACKS = piqirun.pb num
PACKS = piqirun.pb #num


PIQI_FILES = example.piqi skvl.piqi
Expand Down
8 changes: 8 additions & 0 deletions examples/custom-types/piqirun_custom.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ let nativeint_to_int: nativeint -> int = Nativeint.to_int
(* mapping OCaml big_int to Piqi string (by representing number as a decimal
* string)
*)
(*
(* Used to work with OCaml < 4.06 -- commenting out for now; XXX: support num |
* base-num as test dependency *)
type bigint = Big_int.big_int
let bigint_of_string: string -> bigint = Big_int.big_int_of_string
let bigint_to_string: bigint -> string = Big_int.string_of_big_int
*)
type bigint = string

let bigint_of_string (x: string) :bigint = x
let bigint_to_string (x: bigint) :string = x



Expand Down
4 changes: 2 additions & 2 deletions tests/perf/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
let read_file filename =
let ch = open_in_bin filename in
let size = in_channel_length ch in
let res = String.create size in
let res = Bytes.create size in
really_input ch res 0 size;
close_in ch;
res
Bytes.unsafe_to_string res


let string_of_format = function
Expand Down

0 comments on commit 7334da1

Please sign in to comment.