Merge pull request #754 from rgrinberg/path-append-behavior

Unit tests for current Path.append behavior
This commit is contained in:
Rudi Grinberg 2018-05-09 14:50:30 +07:00 committed by GitHub
commit 2dcd95d3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
|}]