cmd/tests: Add tests for variables substrings.
This commit is contained in:
parent
515dd2543e
commit
82cdeb6d4d
|
@ -214,6 +214,19 @@ echo P%ERRORLEVEL%
|
||||||
echo %ERRORLEVEL%S
|
echo %ERRORLEVEL%S
|
||||||
echo P%ERRORLEVEL%S
|
echo P%ERRORLEVEL%S
|
||||||
|
|
||||||
|
echo ------------ Testing variable substrings --------------
|
||||||
|
set VAR=qwerty
|
||||||
|
echo %VAR:~0,1%
|
||||||
|
echo %VAR:~0,3%
|
||||||
|
echo %VAR:~2,2%
|
||||||
|
echo '%VAR:~-2,3%'
|
||||||
|
echo '%VAR:~-2,1%'
|
||||||
|
echo %VAR:~2,-1%
|
||||||
|
echo %VAR:~2,-3%
|
||||||
|
echo '%VAR:~-2,-4%'
|
||||||
|
echo %VAR:~-3,-2%
|
||||||
|
set VAR=
|
||||||
|
|
||||||
echo ------------ Testing variable delayed expansion --------------
|
echo ------------ Testing variable delayed expansion --------------
|
||||||
rem NT4 doesn't support this
|
rem NT4 doesn't support this
|
||||||
echo ...default mode (load-time expansion)
|
echo ...default mode (load-time expansion)
|
||||||
|
|
|
@ -203,6 +203,16 @@ ERRORLEVEL
|
||||||
P0
|
P0
|
||||||
0S
|
0S
|
||||||
P0S
|
P0S
|
||||||
|
------------ Testing variable substrings --------------
|
||||||
|
q
|
||||||
|
qwe
|
||||||
|
er
|
||||||
|
@todo_wine@'ty'@or_broken@''
|
||||||
|
't'@or_broken@''
|
||||||
|
ert@or_broken@qwerty
|
||||||
|
e@or_broken@qwerty
|
||||||
|
''@or_broken@'qwerty'
|
||||||
|
r@or_broken@qwerty
|
||||||
------------ Testing variable delayed expansion --------------
|
------------ Testing variable delayed expansion --------------
|
||||||
...default mode (load-time expansion)
|
...default mode (load-time expansion)
|
||||||
foo
|
foo
|
||||||
|
|
Loading…
Reference in New Issue