:unittest.MakeRelative

Test cases for the :MakeRelative function

Description: call:unittest.MakeRelative
Dependencies: :MakeRelative, :Format
Script:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
:unittest.MakeRelative
:$created 20080219 :$changed 20080219
:$source https://www.dostips.com
for %%C in (
        "c:\windows\win.ini"
        "\windows\win.ini"
        "..\..\windows\..\windows\win.ini"
    ) do (
    set "s=%%~C"
    call:MakeRelative s
    call:Format "[35] [35]." "'%%~C'" "'%%s%%'"
)
EXIT /b
Script Output:
 DOS Script Output
---- :unittest.MakeRelative - output
'c:\windows\win.ini'                '..\..\WINDOWS\win.ini'            .
'\windows\win.ini'                  '..\..\WINDOWS\win.ini'            .
'..\..\windows\..\windows\win.ini'  '..\..\WINDOWS\win.ini'            .
----