:unittest.rTrim

Test cases for the :rTrim function

Description: call:unittest.rTrim
Dependencies: :rTrim, :Format
Script:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
:unittest.rTrim
:$created 20080227 :$changed 20080227
:$source https://www.dostips.com
for %%C in (
        " right trim nothing"
        " right trim one "
        " right trim plenty                  "
    ) do (
    set "s=%%~C"
    call:rTrim s
    call:Format "[35] [35]." "'%%~C'" "'%%s%%'"
)
EXIT /b
Script Output:
 DOS Script Output
---- :unittest.rTrim - output
' right trim nothing'               ' right trim nothing'              .
' right trim one '                  ' right trim one'                  .
' right trim plenty                 ' right trim plenty'               .
----