daemon: utils: New functions and tests.

These utility functions will be used in the OCaml inspection code.
This commit is contained in:
Richard W.M. Jones
2017-07-17 17:01:48 +01:00
parent 2ffb8a6b25
commit 11b8a5db19
3 changed files with 38 additions and 0 deletions

View File

@@ -46,3 +46,13 @@ let () =
let () =
assert (proc_unmangle_path "\\040" = " ");
assert (proc_unmangle_path "\\040\\040" = " ")
(* Test unix_canonical_path. *)
let () =
assert (unix_canonical_path "/" = "/");
assert (unix_canonical_path "/usr" = "/usr");
assert (unix_canonical_path "/usr/" = "/usr");
assert (unix_canonical_path "/usr/local" = "/usr/local");
assert (unix_canonical_path "///" = "/");
assert (unix_canonical_path "///usr//local//" = "/usr/local");
assert (unix_canonical_path "/usr///" = "/usr")