Unit tests for current Path.append behavior

This commit is contained in:
Rudi Grinberg 2018-05-09 09:13:24 +07:00
parent 92220d34a3
commit 7d17a30a99
1 changed files with 30 additions and 0 deletions

View File

@ -128,3 +128,33 @@ Path.insert_after_build_dir_exn (Path.relative Path.build_dir "qux") "foobar"
[%%expect{|
- : Stdune.Path.t = _build/foobar/qux
|}]
Path.append Path.build_dir (Path.relative Path.root "foo")
[%%expect{|
- : Stdune.Path.t = _build/foo
|}]
Path.append Path.build_dir (Path.relative Path.build_dir "foo")
[%%expect{|
- : Stdune.Path.t = _build/_build/foo
|}]
Path.append Path.root (Path.relative Path.build_dir "foo")
[%%expect{|
- : Stdune.Path.t = _build/foo
|}]
Path.append Path.root (Path.relative Path.root "foo")
[%%expect{|
- : Stdune.Path.t = foo
|}]
Path.append (Path.of_string "/root") (Path.relative Path.root "foo")
[%%expect{|
- : Stdune.Path.t = /root/foo
|}]
Path.append (Path.of_string "/root") (Path.relative Path.build_dir "foo")
[%%expect{|
- : Stdune.Path.t = /root/_build/foo
|}]