Add tests for reach_for_running
This commit is contained in:
parent
9fbfc272eb
commit
a834e6f6ba
|
@ -284,3 +284,31 @@ Path.is_in_build_dir Path.build_dir
|
||||||
[%%expect{|
|
[%%expect{|
|
||||||
- : bool = false
|
- : bool = false
|
||||||
|}]
|
|}]
|
||||||
|
|
||||||
|
Path.reach_for_running Path.build_dir ~from:Path.root
|
||||||
|
[%%expect{|
|
||||||
|
- : Stdune.Path.t = ./_build
|
||||||
|
|}]
|
||||||
|
|
||||||
|
Path.(reach_for_running (relative build_dir "foo/baz")
|
||||||
|
~from:(relative build_dir "foo/bar/baz"))
|
||||||
|
[%%expect{|
|
||||||
|
- : Stdune.Path.t = ../../baz
|
||||||
|
|}]
|
||||||
|
|
||||||
|
Path.(reach_for_running (Path.absolute "/fake/path")
|
||||||
|
~from:(relative build_dir "foo/bar/baz"))
|
||||||
|
[%%expect{|
|
||||||
|
- : Stdune.Path.t = /fake/path
|
||||||
|
|}]
|
||||||
|
|
||||||
|
Path.(reach_for_running (relative build_dir "foo/baz")
|
||||||
|
~from:(Path.absolute "/fake/path"))
|
||||||
|
[%%expect{|
|
||||||
|
Exception: Stdune__Exn.Code_error <abstr>.
|
||||||
|
|}]
|
||||||
|
|
||||||
|
Path.(reach_for_running (relative root "foo") ~from:(Path.relative root "foo"))
|
||||||
|
[%%expect{|
|
||||||
|
- : Stdune.Path.t = ./.
|
||||||
|
|}]
|
||||||
|
|
Loading…
Reference in New Issue