Add unit tests for Path.relative

This commit is contained in:
Rudi Grinberg 2018-05-07 22:46:28 +07:00
parent c149043fde
commit 9dcbc4ce53
1 changed files with 20 additions and 0 deletions

View File

@ -81,3 +81,23 @@ Path.reach (Path.of_string "bar/foo") ~from:(Path.of_string "bar/baz/y")
[%%expect{|
- : string = "../../foo"
|}]
Path.relative (Path.of_string "relative") "/absolute/path"
[%%expect{|
- : Stdune.Path.t = /absolute/path
|}]
Path.relative (Path.of_string "/abs1") "/abs2"
[%%expect{|
- : Stdune.Path.t = /abs2
|}]
Path.relative (Path.of_string "/abs1") ""
[%%expect{|
- : Stdune.Path.t = /abs1
|}]
Path.relative Path.root "/absolute/path"
[%%expect{|
- : Stdune.Path.t = /absolute/path
|}]