Frédéric Delanoy : cmd/tests: Add tests for variables substrings.

Alexandre Julliard julliard at winehq.org
Thu Aug 25 13:00:20 CDT 2011


Module: wine
Branch: master
Commit: 82cdeb6d4dd49208a70e0e58c64e1a0e4790d3c7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=82cdeb6d4dd49208a70e0e58c64e1a0e4790d3c7

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Thu Aug 25 14:22:29 2011 +0200

cmd/tests: Add tests for variables substrings.

---

 programs/cmd/tests/test_builtins.cmd     |   13 +++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   10 ++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 1c53cd2..668bea4 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -214,6 +214,19 @@ echo P%ERRORLEVEL%
 echo %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 --------------
 rem NT4 doesn't support this
 echo ...default mode (load-time expansion)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index c9c6521..08a66eb 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -203,6 +203,16 @@ ERRORLEVEL
 P0
 0S
 P0S
+------------ Testing variable substrings --------------
+q
+qwe
+er
+ at todo_wine@'ty'@or_broken@''
+'t'@or_broken@''
+ert at or_broken@qwerty
+e at or_broken@qwerty
+''@or_broken@'qwerty'
+r at or_broken@qwerty
 ------------ Testing variable delayed expansion --------------
 ...default mode (load-time expansion)
 foo




More information about the wine-cvs mailing list