File: test_fpath.ml

package info (click to toggle)
ocaml-crowbar 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: ml: 863; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Crowbar
open Astring
open Fpath
let fpath =
  map [bytes] (fun s ->
    try
      v s
    with
      Invalid_argument _ -> bad_test ())


let () =
  add_test ~name:"segs" [fpath] @@ fun p ->
    let np = normalize p in
    assert (is_dir_path p = is_dir_path np);
    assert (is_file_path p = is_file_path np);
    assert (filename p = filename np);
    check_eq ~eq:equal p (v @@ (fst @@ split_volume p) ^ (String.concat ~sep:dir_sep (segs p)))