:unittest.Trim

Test cases for the :Trim function

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