[Pkg-ocaml-maint-commits] [lwt] 01/12: Imported Upstream version 2.5.1

Stéphane Glondu glondu at moszumanska.debian.org
Thu Jul 28 08:51:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository lwt.

commit a46a9a01317e0e067849287008dd9fad33c59561
Author: Stephane Glondu <steph at glondu.net>
Date:   Thu Jul 28 09:53:25 2016 +0200

    Imported Upstream version 2.5.1
---
 CHANGES                             |   9 +++++++++
 README.md                           |   2 +-
 RELEASE.md                          |  15 ++++++++++++++
 _oasis                              |  10 ++++-----
 discover.ml                         |   5 ++++-
 ppx/ppx_lwt_ex.ml                   |  39 ++++++++++++++++--------------------
 setup-dev.exe                       | Bin 0 -> 3510672 bytes
 setup.ml                            |  14 ++++++-------
 src/core/META                       |  26 ++++++++++++------------
 src/core/lwt_stream.ml              |   4 +++-
 src/core/lwt_stream.mli             |   7 +++++--
 src/unix/lwt_bytes.mli              |   4 ++--
 src/unix/lwt_log.ml                 |   2 +-
 src/unix/lwt_sys.ml                 |   2 +-
 src/unix/lwt_unix.ml                |  18 +++++++++++++++++
 src/unix/lwt_unix.mli               |   6 ++++++
 src/unix/lwt_unix_unix.c            |  38 +++++++++++++++++++++++++++++++++++
 tests/META                          |   4 ++--
 tests/core/test_lwt_stream.ml       |   4 ++--
 tests/unix/test_lwt_io_non_block.ml |   6 ++++++
 20 files changed, 155 insertions(+), 60 deletions(-)

diff --git a/CHANGES b/CHANGES
index 120fb95..56e294e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+===== 2.5.1 (2015-12-07) =====
+
+  * Lwt_stream.on_terminate -> Lwt_stream.on_termination
+  * Lwt_unix: handle O_CLOEXEC
+  * Lwt_log: add OSX syslog path
+  * Ppx: Improve lwt%match, improve catchall detection
+  * Add Lwt_unix.file_exists and Lwt_unix.Large_file.file_exists
+  * Build fixes
+
 ===== 2.5.0 (2015-07-03) =====
 
   * API CHANGE: Functions in Lwt_io that were previously using a
diff --git a/README.md b/README.md
index 72ccd0e..f18194c 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,7 @@ They might also be available through your distribution.
  * run `ocaml setup.ml -install` as root to install compiled libraries
  * run `ocaml setup.ml -uninstall` as root to uninstall them
 
-HTML documentation is generated in _build/lwt.docdir/, but is not
+HTML documentation is generated in `_build/lwt.docdir/`, but is not
 installed by default.
 
 If you get the development version you need to obtain OASIS
diff --git a/RELEASE.md b/RELEASE.md
new file mode 100644
index 0000000..6bfa22b
--- /dev/null
+++ b/RELEASE.md
@@ -0,0 +1,15 @@
+# How to make a release.
+
+
+- Bump the relevant version numbers:
+  - Oasis
+  - CHANGES
+- `sh dist.sh`. It creates a tag and a branch numbered by the version.
+- Push **only the tag and not the branch**. You obtain a tag with no branch.
+- Let github create a tarball.
+- Delete the local branch.
+
+- In [ocsigen.org-data](https://github.com/ocsigen/ocsigen.org-data), copy `tyxml/dev` to the new version number.
+- Add the new version in the [download page](http://ocsigen.org/tyxml/install).
+
+- Publish on opam.
diff --git a/_oasis b/_oasis
index 3d4e50a..f187a89 100644
--- a/_oasis
+++ b/_oasis
@@ -5,7 +5,7 @@
 OASISFormat: 0.4
 OCamlVersion: >= 4.01
 Name: lwt
-Version: 2.5.0
+Version: 2.5.1
 LicenseFile: COPYING
 License: LGPL-2.1 with OCaml linking exception
 Authors:
@@ -26,7 +26,7 @@ Authors:
   Romain Slootmaekers
 Homepage: http://ocsigen.org/lwt/
 BuildTools: ocamlbuild
-Plugins: DevFiles (0.3), META (0.3)
+Plugins: DevFiles (0.4), META (0.4)
 XDevFilesEnableMakefile: false
 PostConfCommand: ocaml discover.ml -ext-obj $ext_obj -exec-name $default_executable_name -use-libev $libev -os-type $os_type -use-glib $glib -ccomp-type $ccomp_type -use-pthread $pthread -use-unix $unix -android-target $android_target -libev_default $libev_default
 PostDistCleanCommand: $rm src/unix/lwt_config.h src/unix/lwt_config.ml src/unix/lwt_unix_jobs_generated.ml src/unix/jobs-unix/*
@@ -429,6 +429,6 @@ Test ppx
 # +-------------------------------------------------------------------+
 
 SourceRepository head
-  Type: darcs
-  Location: http://ocsigen.org/darcs/lwt
-  Browser: http://ocsigen.org/darcsweb/?r=lwt;a=summary
+  Type: git
+  Location: git://github.com/ocsigen/lwt
+  Browser: https://github.com/ocsigen/lwt
diff --git a/discover.ml b/discover.ml
index dae89e8..5cbdcab 100644
--- a/discover.ml
+++ b/discover.ml
@@ -230,6 +230,10 @@ CAMLprim value lwt_test(value Unit)
   he = gethostbyaddr_r((const char *)NULL, (int)0, (int)0,(struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL,(int *)NULL);
   se = getservbyname_r((const char *)NULL, (const char *)NULL,(struct servent *)NULL, (char *)NULL, (int)0, (struct servent **)NULL);
   se = getservbyport_r((int)0, (const char *)NULL,(struct servent *)NULL, (char *)NULL, (int)0, (struct servent **)NULL);
+  pr = getprotoent_r((struct protoent *)NULL, (char *)NULL, (int)0, (struct protoent **)NULL);
+  pr = getprotobyname_r((const char *)NULL, (struct protoent *)NULL, (char *)NULL, (int)0, (struct protoent **)NULL);
+  pr = getprotobynumber_r((int)0, (struct protoent *)NULL, (char *)NULL, (int)0, (struct protoent **)NULL);
+
   return Val_unit;
 }
 "
@@ -744,4 +748,3 @@ Lwt can use pthread or the win32 API.
   (* Generate stubs. *)
   print_endline "Generating C stubs...";
   exit (Sys.command "ocaml src/unix/gen_stubs.ml")
-
diff --git a/ppx/ppx_lwt_ex.ml b/ppx/ppx_lwt_ex.ml
index 19444e5..c881760 100644
--- a/ppx/ppx_lwt_ex.ml
+++ b/ppx/ppx_lwt_ex.ml
@@ -13,6 +13,21 @@ let with_loc f { txt ; loc } =
 let def_loc txt =
   { txt; loc = !default_loc }
 
+(** Test if a pattern is a catchall. *)
+let rec is_catchall p = match p.ppat_desc with
+  | Ppat_any | Ppat_var _ -> true
+  | Ppat_alias (p, _) -> is_catchall p
+  | _ -> false
+
+(** Add a wildcard case in there is none. Useful for exception handlers. *)
+let add_wildcard_case cases =
+  let has_wildcard =
+    List.exists (fun case -> is_catchall case.pc_lhs) cases
+  in
+  if not has_wildcard
+  then cases @ [Exp.case [%pat? exn] [%expr Lwt.fail exn]]
+  else cases
+
 (** {3 Internal names} *)
 
 let lwt_prefix = "__ppx_lwt_"
@@ -121,17 +136,7 @@ let lwt_expression mapper exp attributes =
           { case with pc_lhs = pat }
         | _ -> assert false)
     in
-    let exhaustive =
-      exns |> List.exists (
-        function
-        | { pc_lhs = [%pat? exception _]}
-        | { pc_lhs = [%pat? exception [%p? { ppat_desc = Ppat_var _ }]]} -> true
-        | _ -> false)
-    in
-    let exns =
-      if exhaustive then exns
-      else exns @ [Exp.case (Pat.var (def_loc "__pa_lwt_e")) [%expr Lwt.fail __pa_lwt_e]]
-    in
+    let exns = add_wildcard_case exns in
     let new_exp =
       match exns with
       | [] -> [%expr Lwt.bind [%e e] [%e Exp.function_ cases]]
@@ -195,17 +200,7 @@ let lwt_expression mapper exp attributes =
       [Lwt.catch (fun () -> $e$) (function $c$)]
   *)
   | Pexp_try (expr, cases) ->
-    let has_wildcard =
-      cases |> List.exists (fun case ->
-        match case.pc_lhs.ppat_desc with
-        | Ppat_any | Ppat_var _ -> true
-        | _ -> false)
-    in
-    let cases =
-      if not has_wildcard
-      then cases @ [Exp.case [%pat? exn] [%expr Lwt.fail exn]]
-      else cases
-    in
+    let cases = add_wildcard_case cases in
     let new_exp =
       if !debug then
         [%expr Lwt.backtrace_catch (fun exn -> try raise exn with exn -> exn)
diff --git a/setup-dev.exe b/setup-dev.exe
new file mode 100755
index 0000000..30b3089
Binary files /dev/null and b/setup-dev.exe differ
diff --git a/setup.ml b/setup.ml
index ffdcfdc..2aee449 100644
--- a/setup.ml
+++ b/setup.ml
@@ -8,7 +8,7 @@
  *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: ce9c0f6ecfe9a397e795823c7dab5a5b) *)
+(* DO NOT EDIT (digest: 4532d086a8e7217dc6b470d957196a13) *)
 (*
    Regenerated by OASIS v0.4.5
    Visit http://oasis.forge.ocamlcore.org for more information and
@@ -7005,7 +7005,7 @@ let setup_t =
           alpha_features = ["pure_interface"];
           beta_features = [];
           name = "lwt";
-          version = "2.5.0";
+          version = "2.5.1";
           license =
             OASISLicense.DEP5License
               (OASISLicense.DEP5Unit
@@ -8539,10 +8539,10 @@ let setup_t =
                      cs_plugin_data = []
                   },
                    {
-                      src_repo_type = Darcs;
-                      src_repo_location = "http://ocsigen.org/darcs/lwt";
+                      src_repo_type = Git;
+                      src_repo_location = "git://github.com/ocsigen/lwt";
                       src_repo_browser =
-                        Some "http://ocsigen.org/darcsweb/?r=lwt;a=summary";
+                        Some "https://github.com/ocsigen/lwt";
                       src_repo_module = None;
                       src_repo_branch = None;
                       src_repo_tag = None;
@@ -8550,14 +8550,14 @@ let setup_t =
                    })
             ];
           plugins =
-            [(`Extra, "DevFiles", Some "0.3"); (`Extra, "META", Some "0.3")];
+            [(`Extra, "DevFiles", Some "0.4"); (`Extra, "META", Some "0.4")];
           disable_oasis_section = [];
           schema_data = PropList.Data.create ();
           plugin_data = []
        };
      oasis_fn = Some "_oasis";
      oasis_version = "0.4.5";
-     oasis_digest = Some "wh\202\244\r\023S\027\230G\146m\242\215Z\166";
+     oasis_digest = Some "j\145\203\180x\249\224\242\1589X\023J\007]\211";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false
diff --git a/src/core/META b/src/core/META
index 96947eb..f875429 100644
--- a/src/core/META
+++ b/src/core/META
@@ -1,6 +1,6 @@
 # OASIS_START
-# DO NOT EDIT (digest: d8f0f90a58dae904c500f6a3bd28ab95)
-version = "2.5.0"
+# DO NOT EDIT (digest: 3c1734eda62f399a1b3f12fec3c7772a)
+version = "2.5.1"
 description = "Lightweight thread library for OCaml (core library)"
 requires = "bytes"
 archive(byte) = "lwt.cma"
@@ -9,7 +9,7 @@ archive(native) = "lwt.cmxa"
 archive(native, plugin) = "lwt.cmxs"
 exists_if = "lwt.cma"
 package "unix" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Unix support for lwt"
  requires = "lwt lwt.log unix bigarray"
  archive(byte) = "lwt-unix.cma"
@@ -20,7 +20,7 @@ package "unix" (
 )
 
 package "syntax" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Syntactic sugars for Lwt"
  requires = "camlp4 lwt.syntax.options"
  archive(syntax, preprocessor) = "lwt-syntax.cma"
@@ -29,7 +29,7 @@ package "syntax" (
  archive(syntax, preprocessor, native, plugin) = "lwt-syntax.cmxs"
  exists_if = "lwt-syntax.cma"
  package "options" (
-  version = "2.5.0"
+  version = "2.5.1"
   description = "Options for syntax extensions"
   requires = "camlp4"
   archive(syntax, preprocessor) = "lwt-syntax-options.cma"
@@ -40,7 +40,7 @@ package "syntax" (
  )
  
  package "log" (
-  version = "2.5.0"
+  version = "2.5.1"
   description = "Syntactic sugars for logging"
   requires = "camlp4 lwt.syntax.options"
   archive(syntax, preprocessor) = "lwt-syntax-log.cma"
@@ -52,7 +52,7 @@ package "syntax" (
 )
 
 package "ssl" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "SSL support for Lwt"
  requires = "ssl lwt.unix"
  archive(byte) = "lwt-ssl.cma"
@@ -63,7 +63,7 @@ package "ssl" (
 )
 
 package "simple-top" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Unix support for lwt"
  requires = "lwt lwt.unix compiler-libs.common"
  archive(byte) = "lwt-simple-top.cma"
@@ -74,7 +74,7 @@ package "simple-top" (
 )
 
 package "react" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Reactive programming helpers"
  requires = "lwt react"
  archive(byte) = "lwt-react.cma"
@@ -85,7 +85,7 @@ package "react" (
 )
 
 package "preemptive" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Preemptive threads support for Lwt"
  requires = "lwt lwt.unix threads"
  archive(byte) = "lwt-preemptive.cma"
@@ -96,7 +96,7 @@ package "preemptive" (
 )
 
 package "ppx" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "New-style (ppx) syntax extension"
  requires = "lwt"
  archive(byte) = "ppx.cma"
@@ -108,7 +108,7 @@ package "ppx" (
 )
 
 package "log" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Logger for lwt"
  requires = "lwt"
  archive(byte) = "lwt-log.cma"
@@ -119,7 +119,7 @@ package "log" (
 )
 
 package "glib" (
- version = "2.5.0"
+ version = "2.5.1"
  description = "Glib integration"
  requires = "lwt lwt.unix"
  archive(byte) = "lwt-glib.cma"
diff --git a/src/core/lwt_stream.ml b/src/core/lwt_stream.ml
index 3b949af..307acee 100644
--- a/src/core/lwt_stream.ml
+++ b/src/core/lwt_stream.ml
@@ -153,9 +153,11 @@ let from_direct f =
     hooks = ref [];
   }
 
-let on_terminate s f =
+let on_termination s f =
   s.hooks := f :: !(s.hooks)
 
+let on_terminate = on_termination
+
 let of_list l =
   let l = ref l in
   from_direct
diff --git a/src/core/lwt_stream.mli b/src/core/lwt_stream.mli
index 50eb252..01693c8 100644
--- a/src/core/lwt_stream.mli
+++ b/src/core/lwt_stream.mli
@@ -224,11 +224,14 @@ val get_available_up_to : int -> 'a t -> 'a list
 val is_empty : 'a t -> bool Lwt.t
   (** [is_empty st] returns wether the given stream is empty *)
 
-val on_terminate : 'a t -> (unit -> unit) -> unit
-  (** [on_terminate st f] executes [f] when the end of the stream [st]
+val on_termination : 'a t -> (unit -> unit) -> unit
+  (** [on_termination st f] executes [f] when the end of the stream [st]
       is reached. Note that the stream may still contains elements if
       {!peek} or similar was used. *)
 
+val on_terminate : 'a t -> (unit -> unit) -> unit
+  (* Deprecated, use [on_termination] *)
+
 (** {2 Stream transversal} *)
 
 (** Note: all the following functions are destructive.
diff --git a/src/unix/lwt_bytes.mli b/src/unix/lwt_bytes.mli
index 65b52c7..94df080 100644
--- a/src/unix/lwt_bytes.mli
+++ b/src/unix/lwt_bytes.mli
@@ -175,10 +175,10 @@ val mincore : t -> int -> bool array -> unit
       each cases is [true] if the corresponding page is in RAM and
       [false] otherwise.
 
-      This call is not available on windows. *)
+      This call is not available on windows and cygwin. *)
 
 val wait_mincore : t -> int -> unit Lwt.t
   (** [wait_mincore buffer offset] waits until the page containing the
       byte at offset [offset] is in RAM.
 
-      This functions is not available on windows. *)
+      This functions is not available on windows and cygwin. *)
diff --git a/src/unix/lwt_log.ml b/src/unix/lwt_log.ml
index 13f401c..70b68c8 100644
--- a/src/unix/lwt_log.ml
+++ b/src/unix/lwt_log.ml
@@ -241,7 +241,7 @@ let truncate buf max =
   end else
     Buffer.contents buf
 
-let syslog ?(template="$(date) $(name)[$(pid)]: $(section): $(message)") ?(paths=["/dev/log"; "/var/run/log"]) ~facility () =
+let syslog ?(template="$(date) $(name)[$(pid)]: $(section): $(message)") ?(paths=["/dev/log"; "/var/run/log"; "/var/run/syslog"]) ~facility () =
   let syslog_socket = ref None and mutex = Lwt_mutex.create () in
   let get_syslog () = match !syslog_socket with
     | Some x ->
diff --git a/src/unix/lwt_sys.ml b/src/unix/lwt_sys.ml
index 7745242..6c0ca7e 100644
--- a/src/unix/lwt_sys.ml
+++ b/src/unix/lwt_sys.ml
@@ -44,8 +44,8 @@ let have = function
   | `wait4
   | `recv_msg
   | `send_msg
-  | `mincore
   | `madvise -> not Sys.win32
+  | `mincore -> not (Sys.win32 || Sys.cygwin)
   | `get_cpu -> Lwt_config._HAVE_GETCPU
   | `get_affinity
   | `set_affinity -> Lwt_config._HAVE_AFFINITY
diff --git a/src/unix/lwt_unix.ml b/src/unix/lwt_unix.ml
index cae752c..641b18e 100644
--- a/src/unix/lwt_unix.ml
+++ b/src/unix/lwt_unix.ml
@@ -757,6 +757,15 @@ let fstat ch =
   else
     run_job (fstat_job ch.fd)
 
+let file_exists name =
+  Lwt.try_bind
+    (fun () -> stat name)
+    (fun _ -> Lwt.return_true)
+    (fun e ->
+       match e with
+       | Unix.Unix_error (Unix.ENOENT, _, _) -> Lwt.return_false
+       | _ -> Lwt.fail e)
+
 external isatty_job : Unix.file_descr -> bool job = "lwt_unix_isatty_job"
 
 let isatty ch =
@@ -835,6 +844,15 @@ struct
     else
       run_job (fstat_job ch.fd)
 
+  let file_exists name =
+    Lwt.try_bind
+      (fun () -> stat name)
+      (fun _ -> Lwt.return_true)
+      (fun e ->
+         match e with
+         | Unix.Unix_error (Unix.ENOENT, _, _) -> Lwt.return_false
+         | _ -> Lwt.fail e)
+
 end
 
 (* +-----------------------------------------------------------------+
diff --git a/src/unix/lwt_unix.mli b/src/unix/lwt_unix.mli
index c0a999f..91d716e 100644
--- a/src/unix/lwt_unix.mli
+++ b/src/unix/lwt_unix.mli
@@ -416,6 +416,9 @@ val lstat : string -> stats Lwt.t
 val fstat : file_descr -> stats Lwt.t
   (** Wrapper for [Unix.fstat] *)
 
+val file_exists : string -> bool Lwt.t
+  (** [file_exists name] tests if a file named [name] exists. *)
+
 val isatty : file_descr -> bool Lwt.t
   (** Wrapper for [Unix.isatty] *)
 
@@ -456,6 +459,9 @@ module LargeFile : sig
 
   val fstat : file_descr -> stats Lwt.t
     (** Wrapper for [Unix.LargeFile.fstat] *)
+
+  val file_exists : string -> bool Lwt.t
+    (** [file_exists name] tests if a file named [name] exists. *)
 end
 
 (** {2 Operations on file names} *)
diff --git a/src/unix/lwt_unix_unix.c b/src/unix/lwt_unix_unix.c
index 2b2adae..cc05c12 100644
--- a/src/unix/lwt_unix_unix.c
+++ b/src/unix/lwt_unix_unix.c
@@ -87,6 +87,9 @@ CAMLprim value lwt_unix_get_page_size(value Unit)
   return Val_long(page_size);
 }
 
+#ifdef __CYGWIN__
+LWT_NOT_AVAILABLE4(unix_mincore)
+#else
 CAMLprim value lwt_unix_mincore(value val_buffer, value val_offset, value val_length, value val_states)
 {
   long len = Wosize_val(val_states);
@@ -97,6 +100,7 @@ CAMLprim value lwt_unix_mincore(value val_buffer, value val_offset, value val_le
     Field(val_states, i) = Val_bool(vec[i] & 1);
   return Val_unit;
 }
+#endif
 
 /* +-----------------------------------------------------------------+
    | read/write                                                      |
@@ -777,6 +781,9 @@ CAMLprim value lwt_unix_guess_blocking_job(value val_fd)
    | JOB: wait_mincore                                               |
    +-----------------------------------------------------------------+ */
 
+#ifdef __CYGWIN__
+LWT_NOT_AVAILABLE2(unix_wait_mincore_job)
+#else
 struct job_wait_mincore {
   struct lwt_unix_job job;
   char *ptr;
@@ -801,6 +808,7 @@ CAMLprim value lwt_unix_wait_mincore_job(value val_buffer, value val_offset)
   job->ptr = (char*)Caml_ba_data_val(val_buffer) + Long_val(val_offset);
   return lwt_unix_alloc_job(&(job->job));
 }
+#endif
 
 /* +-----------------------------------------------------------------+
    | JOB: open                                                       |
@@ -832,9 +840,24 @@ static int open_flag_table[] = {
   O_DSYNC,
   O_SYNC,
   O_RSYNC,
+  0,
+#ifdef O_CLOEXEC
+  O_CLOEXEC
+#else
+#define NEED_CLOEXEC_EMULATION
   0
+#endif
 };
 
+#ifdef NEED_CLOEXEC_EMULATION
+static int open_cloexec_table[14] = {
+  0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0,
+  0,
+  1
+};
+#endif
+
 struct job_open {
   struct lwt_unix_job job;
   int flags;
@@ -850,6 +873,18 @@ static void worker_open(struct job_open *job)
 {
   int fd;
   fd = open(job->name, job->flags, job->perms);
+#if defined(NEED_CLOEXEC_EMULATION) && defined(FD_CLOEXEC)
+  if (fd >= 0 && job->fd) {
+    int flags = fcntl(fd, F_GETFD, 0);
+    if (flags == -1 ||
+        fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
+      int serrno = errno;
+      close(fd);
+      errno = serrno;
+      fd = -1;
+    }
+  }
+#endif
   job->fd = fd;
   job->error_code = errno;
   if (fd >= 0) {
@@ -875,6 +910,9 @@ static value result_open(struct job_open *job)
 CAMLprim value lwt_unix_open_job(value name, value flags, value perms)
 {
   LWT_UNIX_INIT_JOB_STRING(job, open, 0, name);
+#ifdef NEED_CLOEXEC_EMULATION
+  job->fd = convert_flag_list(flags, open_cloexec_table) != 0;
+#endif
   job->flags = convert_flag_list(flags, open_flag_table);
   job->perms = Int_val(perms);
   return lwt_unix_alloc_job(&(job->job));
diff --git a/tests/META b/tests/META
index 188f00f..3ba362d 100644
--- a/tests/META
+++ b/tests/META
@@ -1,6 +1,6 @@
 # OASIS_START
-# DO NOT EDIT (digest: 97adf7f628c7a39db78b0809dd9694bb)
-version = "2.5.0"
+# DO NOT EDIT (digest: 7d45969588e64211e57bd2f56402e4f7)
+version = "2.5.1"
 description = "Lightweight thread library for OCaml"
 requires = "lwt unix lwt.unix"
 archive(byte) = "test.cma"
diff --git a/tests/core/test_lwt_stream.ml b/tests/core/test_lwt_stream.ml
index 73874b0..c7367aa 100644
--- a/tests/core/test_lwt_stream.ml
+++ b/tests/core/test_lwt_stream.ml
@@ -279,11 +279,11 @@ let suite = suite "lwt_stream" [
        Lwt_stream.to_list (Lwt_stream.map_exn stream) >>= fun l' ->
        return (l = l'));
 
-  test "on_terminate"
+  test "on_termination"
     (fun () ->
       let st = Lwt_stream.of_list [1; 2] in
       let b = ref false in
-      Lwt_stream.on_terminate st (fun () -> b := true);
+      Lwt_stream.on_termination st (fun () -> b := true);
       ignore (Lwt_stream.peek st);
       let b1 = !b = false in
       ignore (Lwt_stream.junk st);
diff --git a/tests/unix/test_lwt_io_non_block.ml b/tests/unix/test_lwt_io_non_block.ml
index 2e4854d..a1f3478 100644
--- a/tests/unix/test_lwt_io_non_block.ml
+++ b/tests/unix/test_lwt_io_non_block.ml
@@ -35,6 +35,9 @@ let open_and_read_filename () =
   return ()
 
 let suite = suite "lwt_io non blocking io" [
+  test "file does not exist"
+    (fun () -> Lwt_unix.file_exists test_file >|= fun r -> not r);
+
   test "create file"
     (fun () ->
       open_file ~mode:output test_file >>= fun out_chan ->
@@ -42,6 +45,9 @@ let suite = suite "lwt_io non blocking io" [
       close out_chan >>= fun () ->
       return true);
 
+  test "file exists"
+    (fun () -> Lwt_unix.file_exists test_file);
+
   test "read file"
     (fun () ->
       open_file ~mode:input test_file >>= fun in_chan ->

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/lwt.git



More information about the Pkg-ocaml-maint-commits mailing list