From 1af1317a7826e4476ba36fc7c5f9fecfc021a457 Mon Sep 17 00:00:00 2001 From: "Hezekiah M. Carty" Date: Tue, 5 May 2020 00:47:15 -0600 Subject: [PATCH] Get tests working on Windows (#5) --- examples/ic.expected | 4 ++-- examples/ic.ml | 3 ++- examples/ic_lwt.expected | 9 +-------- examples/ic_lwt.ml | 6 ++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/examples/ic.expected b/examples/ic.expected index 353b355..7533a39 100644 --- a/examples/ic.expected +++ b/examples/ic.expected @@ -1,7 +1,7 @@ let () = + set_binary_mode_out stdout true; let ic = open_in_bin "ic.ml" in [%defer close_in ic]; let length = in_channel_length ic in let bytes = really_input_string ic length in - print_endline bytes - + print_string bytes diff --git a/examples/ic.ml b/examples/ic.ml index 104ffbb..7533a39 100644 --- a/examples/ic.ml +++ b/examples/ic.ml @@ -1,6 +1,7 @@ let () = + set_binary_mode_out stdout true; let ic = open_in_bin "ic.ml" in [%defer close_in ic]; let length = in_channel_length ic in let bytes = really_input_string ic length in - print_endline bytes + print_string bytes diff --git a/examples/ic_lwt.expected b/examples/ic_lwt.expected index f93bebd..70c379b 100644 --- a/examples/ic_lwt.expected +++ b/examples/ic_lwt.expected @@ -1,8 +1 @@ -let promise = - let%lwt ic = Lwt_io.open_file ~mode:Lwt_io.input "ic_lwt.ml" in - [%defer.lwt Lwt_io.close ic]; - let%lwt bytes = Lwt_io.read ic in - Lwt_io.printl bytes - -let () = Lwt_main.run promise - +Hello world \ No newline at end of file diff --git a/examples/ic_lwt.ml b/examples/ic_lwt.ml index bef5f25..110beff 100644 --- a/examples/ic_lwt.ml +++ b/examples/ic_lwt.ml @@ -1,7 +1,5 @@ let promise = - let%lwt ic = Lwt_io.open_file ~mode:Lwt_io.input "ic_lwt.ml" in - [%defer.lwt Lwt_io.close ic]; - let%lwt bytes = Lwt_io.read ic in - Lwt_io.printl bytes + [%defer.lwt Lwt_io.write Lwt_io.stdout " world"]; + Lwt_io.write Lwt_io.stdout "Hello" let () = Lwt_main.run promise