File: test_file.ml

package info (click to toggle)
mlpost 0.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,844 kB
  • sloc: ml: 21,094; javascript: 4,047; makefile: 430; ansic: 34; lisp: 19; sh: 15
file content (17 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
open FrameWork

let test_from_string =
  Test.mk ~name:"from_string" (fun () ->
      let s = "toto.mps" in
      let f = File.from_string s in
      Assert.eq ~s:"toto.mps" (File.to_string f) "toto.mps";
      let p = File.set_ext f "pdf" in
      Assert.eq ~s:"toto.pdf" (File.to_string p) "toto.pdf")

let test_dir_from_string =
  Test.mk ~name:"dir_from_string" (fun () ->
      let s = "/toto/blop/blip" in
      let f = File.Dir.from_string s in
      Assert.eq ~s (File.Dir.to_string f) s)

let tests = [ test_from_string; test_dir_from_string ]