mirror of
https://github.com/TheLocehiliosan/yadm
synced 2026-03-02 03:49:29 +00:00
Make relative_path match full dir and not just a prefix
Before this change, relative_path "/A/B/C" "/A/B/CD" would return "" instead of the correct "../CD".
This commit is contained in:
@@ -11,11 +11,16 @@ import pytest
|
||||
("/A/B/C", "/A/B/C", ""),
|
||||
("/A/B/C", "/A/B/C/D", "D"),
|
||||
("/A/B/C", "/A/B/C/D/E", "D/E"),
|
||||
("/A/B/C", "/A/B/CD", "../CD"),
|
||||
("/A/B/C", "/A/BB/C", "../../BB/C"),
|
||||
("/A/B/C", "/A/B/D", "../D"),
|
||||
("/A/B/C", "/A/B/D/E", "../D/E"),
|
||||
("/A/B/C", "/A/D", "../../D"),
|
||||
("/A/B/C", "/A/D/E", "../../D/E"),
|
||||
("/A/B/C", "/D/E/F", "../../../D/E/F"),
|
||||
("/", "/A/B/C", "A/B/C"),
|
||||
("/A/B/C", "/", "../../.."),
|
||||
("/A/B B/C", "/A/C C/D", "../../C C/D"),
|
||||
],
|
||||
)
|
||||
def test_relative_path(runner, paths, base, full_path, expected):
|
||||
|
||||
Reference in New Issue
Block a user