Add tests for Path.drop_build_context

This commit is contained in:
Rudi Grinberg 2018-05-11 09:42:39 +07:00
parent f9f15ceacf
commit 909142cf6c
1 changed files with 18 additions and 1 deletions

View File

@ -165,6 +165,23 @@ Path.rm_rf (Path.of_string "/does/not/exist/foo/bar/baz")
[%%expect{|
Exception: Stdune__Exn.Code_error <abstr>.
|}]
Path.drop_build_context (Path.relative Path.build_dir "foo/bar")
[%%expect{|
- : (unit, exn) Stdune.result = Error (Stdune__Exn.Code_error _)
- : Stdune.Path.t option = Some bar
|}]
Path.drop_build_context (Path.of_string "foo/bar")
[%%expect{|
- : Stdune.Path.t option = None
|}]
Path.drop_build_context (Path.absolute "/foo/bar")
[%%expect{|
- : Stdune.Path.t option = None
|}]
Path.drop_build_context Path.build_dir
[%%expect{|
- : Stdune.Path.t option = None
|}]