1 2@pwd@>echo Tests for cmd's builtin commands@space@ 3Tests for cmd's builtin commands 4 5@pwd@>echo ------------ Testing 'echo' [ON] ------------@space@ 6------------ Testing 'echo' [ON] ------------ 7 8@pwd@>echo word@space@ 9word 10 11@pwd@>echo 'singlequotedword'@space@ 12'singlequotedword' 13 14@pwd@>echo "doublequotedword"@space@ 15"doublequotedword" 16at-echoed-word 17 18@pwd@>echo "/?"@space@ 19"/?" 20 21@pwd@>echo. 22 23 24@pwd@>echo .@space@ 25. 26 27@pwd@>echo.word 28word 29 30@pwd@>echo .word@space@ 31.word 32 33@pwd@>echo: 34 35 36@pwd@>echo :@space@ 37: 38 39@pwd@>echo:word 40word 41 42@pwd@>echo :word@space@ 43:word 44 45@pwd@>echo/ 46 47 48@pwd@>echo /@space@ 49/ 50 51@pwd@>echo/word 52word 53 54@pwd@>echo /word@space@ 55/word 56 57@pwd@>echo off now@space@ 58off now 59 60@pwd@>echo word@space@@space@ 61word@space@ 62 63@pwd@>echo word@space@@space@@space@ 64word@space@@space@ 65 66@pwd@>echo word@space@ 67word 68 69@pwd@>echo@tab@word@space@ 70word 71 72@pwd@>echo@tab@word@space@@tab@@space@ 73word@space@@tab@ 74 75@pwd@>echo@tab@word@tab@@space@@space@ 76word@tab@@space@ 77 78@pwd@>echo word@space@ 79word 80 81@pwd@>echo@space@@tab@word@space@ 82@tab@word 83 84@pwd@>echo@space@@space@@tab@word@space@ 85@space@@tab@word 86 87@pwd@>echo@tab@@tab@word@space@ 88@tab@word 89 90@pwd@>echo @tab@ on @space@@space@ 91--- @ with chains and brackets 92 93@todo_wine@@pwd@>(echo the @ character chains until && ) && echo and can hide brackets || () ||@space@ 94@todo_wine@the @ character chains until 95@todo_wine@we leave the current depth 96@todo_wine@and can hide brackets 97@todo_wine@--- 98noecho1 99noecho2 100echo3 101------------ Testing 'echo' [OFF] ------------ 102word 103'singlequotedword' 104"doublequotedword" 105at-echoed-word 106"/?" 107 108. 109word 110.word 111 112: 113word 114:word 115 116/ 117word 118/word 119on again 120word@space@ 121word@space@@space@ 122word 123word 124word@space@@tab@ 125word@tab@@space@ 126word 127@tab@word 128@space@@tab@word 129@tab@word 130------------ Testing mixed echo modes ------------ 131@echo on 132if 1==1 echo foo 133if 1==1 @echo bar 134@echo off 135if 1==1 echo foo2 136if 1==1 @echo bar2 137 138@todo_wine@@pwd@>if 1 == 1 echo foo@space@ 139foo 140 141@todo_wine@@pwd@>if 1 == 1@space@ 142bar 143foo2 144bar2 145------------ Testing parameterization ------------ 146'a', 'b', 'c' 147'"a b c"', '', '' 148'"a b"\c', '', '' 149'a', '~`+', '.{}!+b' 150'a', 'b', '' 151'"a;b"', '', '' 152'a', 'b', '' 153'a[b]{c}(d)e', '', '' 154'a', '', '' 155second line 156'a', 'b', 'c' 157'a', 'b', 'c' 158'a', 'b', '' 159------------ Testing rem ------------ 160 161@pwd@>rem Hello@space@ 162 163@pwd@>rem Hello@space@ 164 165@pwd@>rem Hello || foo@space@ 166 167@pwd@>rem echo lol@space@ 168 169@pwd@>rem echo foo & echo bar@space@ 170 171@pwd@>rem @tab@ Hello@space@ 172 173@pwd@>rem@tab@ Hello@space@ 174 175@pwd@>rem@tab@echo foo & echo bar@space@ 176------------ Testing redirection operators ------------ 177--- stdout redirection 178foo 179foo@space@ 180foo@tab@ 181foo@space@ 182foo@tab@ 183foo7@space@@or_broken@foo@tab@ 184foo9@space@@or_broken@foo@tab@ 185foo1 186foo11 187foo12 188foo13 189foo14 190foo15 191--- stdout appending 192foo 193foo@space@ 194foob@space@ 195foob@space@ 196fooc@space@ 197foob@space@ 198fooc@space@ 199food1 200foob@space@ 201fooc@space@ 202food1 203food2 204food21 205@todo_wine@foo7@space@@space@@or_broken@not supported@space@ 206@todo_wine@foo@or_broken@not supported 207--- redirections within IF statements 208foo1 209foo2 210----- 211foo2 212foo3 213file does not exist, ok 214foo4 215baz5 216baz6@space@ 217baz7 218baz8 219baz 220foo@space@ 221baz 222foo 223A 224B 225C 226------------ Testing circumflex escape character ------------ 227hello, world 228hello, world 229hell^o, world 230hell^o, world 231helloworld 232hello 233world 234hello 235 236finished 237baz 238baz 239foo | echo bar 240foo & echo bar 241bak & 242baz@space@ 2430@or_broken@1 244foo > foo 245< 246ffoof 247WINE_FOO=bar | baz 2480 249WINE_FOO=bar ^| baz 250bar | baz 2510 252------------ Testing chains ------------ 253--- chain success 254a1 255a2 256b1 257b2 258c1 259@todo_wine@--- 260d1 261d2 262d3 263e1 264e2 265e3 266f1 267f2 268@todo_wine@--- 269g1 270g2 271g3 272h1 273h2 274h3 275i1 276i2 277@todo_wine@--- 278j1 279@todo_wine@j3 280@todo_wine@--- 281k1 282@todo_wine@--- 283l1 284@todo_wine@--- 285--- chain failure 286a1 287a2 288b1 289@todo_wine@--- 290c1 291c2 292d1 293d2 294d3 295e1 296e2 297@todo_wine@--- 298f1 299f2 300f3 301g1 302@todo_wine@g3 303@todo_wine@--- 304h1 305@todo_wine@--- 306i1 307@todo_wine@i3 308@todo_wine@--- 309j1 310j2 311j3 312k1 313k2 314@todo_wine@--- 315l1 316l2 317l3 318--- chain brackets 319a1 320a2 321a3 322b1 323b2 324b3 325c1 326c2 327@todo_wine@--- 328d1 329d2 330d3 331e1 332e2 333e3 334f1 335f2 336@todo_wine@--- 337g1 338@todo_wine@--- 339h1 340@todo_wine@--- 341i1 342@todo_wine@--- 343j1 344j2 345j3 346k1 347k2 348@todo_wine@--- 349l1 350l2 351l3 352m1 353@todo_wine@--- 354n1 355@todo_wine@--- 356o1 357@todo_wine@--- 358p1 359p2 360p3 361q1 362q2 363@todo_wine@--- 364r1 365r2 366r3 367--- chain pipe 368@todo_wine@a@space@ 369@todo_wine@a@space@ 370--- 371b2 372c1 373c3 374d1 375@todo_wine@--- 376e1 377e3 378f2 379f3 380g2 381@todo_wine@--- 382h2 383h3 384i3 385--- chain pipe input 386a2:[a1,a2] 387b3:[b2:[b1,b2],b3]@or_broken@b3:[b2:,b3] 388c4:[c3:[c2:[c1,c2],c3],c4]@or_broken@c4:[c3:[c2:,c3],c4]@or_broken@c4:[c3:,c4] 389d2:[d1,d2] 390e3:[e2:[e1,e2],e3]@or_broken@e3:[e2:,e3] 391f4:[f3:[f2:[f1,f2],f3],f4]@or_broken@f4:[f3:[f2:,f3],f4]@or_broken@f4:[f3:,f4] 392--- chain else 393a1 394b2 395@todo_wine@--- 396@todo_wine@c3 397@todo_wine@--- 398@todo_wine@d3 399@todo_wine@--- 400@todo_wine@--- 401@todo_wine@--- 402@todo_wine@--- 403@todo_wine@--- 404--- chain else (if true) 405a1 else echo a2 406b2 else echo b3 407c1 408c2 else echo c3 409d1 410@todo_wine@--- 411e1 412e2 else echo e3 413f3 414g1 else echo g2 415g3 416h1 else echo h2 417@todo_wine@--- 418i1 else echo i2 419i3 420@todo_wine@j2@space@ 421@todo_wine@--- 422k1 423k2 424l1 425@todo_wine@--- 426m1 427m2 428n1 429o1 430p1 431q1 432@todo_wine@--- 433--- chain else (if false) 434j3 435--- 436k3 437l3 438m3 439n3 440o2 441o3 442p2 443@todo_wine@--- 444q2 445q3 446------------ Testing 'set' ------------ 4471 4480 449WINE_FOOBAR not defined 450 baz 451WINE_FOOBAR = baz 4520 453 baz2 4540 455 bar 456WINE_FOOBAR= bar 457WINE_FOOBAR = baz2 458WINE_FOOBAR = baz2 459WINE_FOOBAR not defined 4601 461bar 462foobar 463WINE_FOO not defined 464WINE_BAZ=bazbaz 465bazbaz 466set "WINE_FOO=bar" should not include the quotes in the variable value 467bar 468foo 469'' 470'foo@space@' 471'foo@tab@' 472'value@space@' 473'value' 474'jim fred' 475'"jim" fred' 476'jim fred' 477'jim' 478'apple"banana"grape' 479I'm here!@space@ 480I'm here!@space@ 481I'm here!@space@ 482------------ Testing 'choice' ------------ 483@todo_wine@Example message [A,B,C]?A@or_broken@choice unavailable 484@todo_wine@1@or_broken@9009 485@todo_wine@Example message [A,B,C]?B@or_broken@choice unavailable 486@todo_wine@2@or_broken@9009 487@todo_wine@[D,E,F]?F@or_broken@choice unavailable 488@todo_wine@3@or_broken@9009 489@todo_wine@[A,B,C,X,Y,Z]?Y@or_broken@choice unavailable 490@todo_wine@5@or_broken@9009 491@todo_wine@A@or_broken@choice unavailable 492@todo_wine@1@or_broken@9009 493@todo_wine@[a,b,c,A,B,C]?A@or_broken@choice unavailable 494@todo_wine@4@or_broken@9009 495@todo_wine@255@or_broken@9009 496------------ Testing variable expansion ------------ 497~p0 should be path containing batch file 498@path@ 499@path@ 500~dp0 should be directory containing batch file 501@drive@@path@ 502@drive@@path@ 503CD value @pwd@@or_broken@CD value@space@ 504% 505P 506P 507S 508P 509PS 510ERRORLEVEL 5110 51200 5130ERRORLEVEL 5140 5150% 516P0 5170S 518P0S 519------------ Testing variable substrings ------------ 520q 521qwe 522er 523'ty'@or_broken@'' 524't'@or_broken@'' 525ert@or_broken@qwerty 526e@or_broken@qwerty 527''@or_broken@'qwerty' 528r@or_broken@qwerty 529------------ Testing variable substitution ------------ 530--- in FOR variables 531"A B" 532C 533"A B" 534C 535'A B'@or_broken@'' 536'C'@or_broken@'' 537@drive@@path@C D@or_broken@%~ff 538@drive@@path@E@or_broken@%~ff 539@drive@ 540@drive@ 541@path@@or_broken@%~pd 542@path@@or_broken@%~pd 543L M 544N 545'.OOL' 546'.TABC' 547'' 548'@drive@@shortpath@R S'@or_broken@'' 549'@drive@@shortpath@T'@or_broken@'' 550'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' 551''@or_broken@'%~ai' 552''@or_broken@'%~ai' 553'--a------'@or_broken@'--a--------'@or_broken@'--a--c---'@or_broken@'%~ai' 554'5'@or_broken@'%~zi' 555''@or_broken@'%~ti' 556''@or_broken@'%~ti' 557''@or_broken@'%~zi' 558''@or_broken@'%~zi' 559@drive@@path@ 560@drive@@path@ 561@drive@ 562@drive@ 563@drive@ 564@drive@ 565'' 566'.eh' 567',,,,,,,,,' 568--- in parameters 569"A B" 570C 571'A B'@or_broken@'' 572'C'@or_broken@'' 573@drive@@path@C D 574@drive@@path@E 575@drive@ 576@drive@ 577@path@ 578@path@ 579L M 580N 581'.OOL' 582'.TABC' 583'' 584'@drive@@shortpath@R S'@or_broken@'' 585'@drive@@shortpath@T'@or_broken@'' 586'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' 587@drive@@path@ 588@drive@@path@ 589@drive@ 590@drive@ 591@drive@ 592@drive@ 593'' 594'.eh'@or_broken@'' 595------------ Testing parameter zero ------------ 596:func parm1 597[:func] [@drive@] [@path@] [test] [.cmd] [@drive@@shortpath@test.cmd] 598------------ Testing variable delayed expansion ------------ 599--- default mode (load-time expansion) 600foo 601!WINE_FOO! 602foo 603foo 604--- runtime (delayed) expansion mode 605foo 606foo@or_broken@!WINE_FOO! 607foo 608bar@or_broken@foo 6090 6100@or_broken@1 611foo 612!WINE_FOO! 613--- using /V cmd flag 614foo 615foo@or_broken@!WINE_FOO! 616foo 617!WINE_FOO! 618------------ Testing conditional execution ------------ 619--- unconditional ampersand 620foo1 621bar2@space@ 622foo2 623foobar deleted 624--- on success conditional and 625@todo_wine@foo3 not created 626bar4@space@ 627foo4 628--- on failure conditional or 629foo5 630foo6@space@ 631@todo_wine@------------ Testing cd ------------ 632singleFile 633Current dir: @drive@@path@foobar@or_broken@Current dir:@space@ 634@drive@@path@foobar 635@pwd@ 636@drive@@path@foobar 637@pwd@ 638@drive@@path@foobar 639@pwd@ 640@pwd@ 641@pwd@ 642@drive@@path@foobar\bar bak 643@drive@@path@foobar\bar bak 644@drive@@path@foobar\bar bak 645@drive@@path@foobar\bar bak 646@drive@@path@foobar\bar bak 647@pwd@ 648@drive@@path@foobar 649------------ Testing type ------------ 650 651@pwd@>type foobaz@space@ 652bar 653 654@pwd@>echo ---@space@ 655--- 656bar 657---1 658bar 659---2 660bar 661---3 662---4 663---5 664bar 665foo 666---6 667 668foobaz 669 670 671 672foobay 673 674 675---7 676------------ Testing NUL ------------ 677bar 678bar 679bar 680NUL 681foo created 682Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 683Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 684Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 685Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 686Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 687Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on NT4 688------------ Testing if/else ------------ 689--- if/else should work with blocks 690if seems to work 691else seems to work 692if seems not to detect /c as parameter 693else if seems to work 694else if seems to work 695else if seems to work 696expected1 697expected post-embedded if 698comparison operators surrounded by brackets seem to work 699comparison operators surrounded by brackets seem to work 700comparison operators surrounded by brackets seem to work 701comparison operators surrounded by brackets seem to work 702windir is defined 703windir does exist 704--- case sensitivity with and without /i option 705if seems to default to case sensitivity 706if /i seems to work 707if /I seems to work 708--- string comparisons 709equal 710non equal 711non equal 712equal 713--- tabs handling 714doom 715doom 716doom 717lol 718quake 719quake 720quake 721--- comparison operators 722------ for strings 723LSS string can be used as operand for LSS comparison 724floats are handled as strings 725numbers in quotes are handled as strings 726negative numbers as well@or_broken@NT4 727if /i seems to work for LSS 728A LSS B 729A LSS AB 730A LSS BA 731A LSS AA 732B LSS BA 733AB LSS B 734AB LSS BA 735AA LSS B 736AA LSS AB 737AA LSS BA 738b LSS B@or_broken@NT4 739a LSS B@or_broken@NT4 740a LSS B insensitive 741A LSS b 742A LSS b insensitive 743A LEQ A 744A LEQ B 745A LEQ AB 746A LEQ BA 747A LEQ AA 748B LEQ B 749B LEQ BA 750AB LEQ B 751AB LEQ AB 752AB LEQ BA 753BA LEQ BA 754AA LEQ B 755AA LEQ AB 756AA LEQ BA 757AA LEQ AA 758b LEQ B@or_broken@NT4 759b LEQ B insensitive 760a LEQ B@or_broken@NT4 761a LEQ B insensitive 762A LEQ b 763A LEQ b insensitive 764A EQU A 765B EQU B 766AB EQU AB 767BA EQU BA 768AA EQU AA 769A EQU a insensitive 770A NEQ B 771A NEQ AB 772A NEQ BA 773A NEQ AA 774B NEQ A 775B NEQ AB 776B NEQ BA 777B NEQ AA 778AB NEQ A 779AB NEQ B 780AB NEQ BA 781AB NEQ AA 782BA NEQ A 783BA NEQ B 784BA NEQ AB 785BA NEQ AA 786AA NEQ A 787AA NEQ B 788AA NEQ AB 789AA NEQ BA 790A GEQ A 791B GEQ A 792B GEQ B 793B GEQ AB 794B GEQ AA 795AB GEQ A 796AB GEQ AB 797AB GEQ AA 798BA GEQ A 799BA GEQ B 800BA GEQ AB 801BA GEQ BA 802BA GEQ AA 803AA GEQ A 804AA GEQ AA 805B GTR A 806B GTR AB 807B GTR AA 808AB GTR A 809AB GTR AA 810BA GTR A 811BA GTR B 812BA GTR AB 813BA GTR AA 814AA GTR A 815------------ Testing if/exist ------------ 816exist explicit works 817exist explicit unknown file works 818exist explicit in subdir works 819exist simple wildcard works 820exist wildcard works 821negate exist wildcard works 822exist wildcard bad subdir broken works 823exist subdir ok 824exist subdir with . ok 825exist subdir with \ ok 826exist subdir with \ and quotes ok 827------ for numbers 828negative numbers handled 829negative numbers handled 830octal handled 831also in negative form 832hexa handled 833also in negative form 83411 LSS 101 8350 LSS 1 8360 LSS 10 8370 LSS 9 8381 LSS 10 8391 LSS 9 8409 LSS 10 8410 LEQ 0 8420 LEQ 1 8430 LEQ 10 8440 LEQ 9 8451 LEQ 1 8461 LEQ 10 8471 LEQ 9 84810 LEQ 10 8499 LEQ 10 8509 LEQ 9 8510 EQU 0 8521 EQU 1 85310 EQU 10 8549 EQU 9 855octal ok 856hexa ok 857string/hexa compare ok 858string/hexa compare ok 8590 NEQ 1 8600 NEQ 10 8610 NEQ 9 8621 NEQ 0 8631 NEQ 10 8641 NEQ 9 86510 NEQ 0 86610 NEQ 1 86710 NEQ 9 8689 NEQ 0 8699 NEQ 1 8709 NEQ 10 8710 GEQ 0 8721 GEQ 0 8731 GEQ 1 87410 GEQ 0 87510 GEQ 1 87610 GEQ 10 87710 GEQ 9 8789 GEQ 0 8799 GEQ 1 8809 GEQ 9 8811 GTR 0 88210 GTR 0 88310 GTR 1 88410 GTR 9 8859 GTR 0 8869 GTR 1 887------ for numbers and stringified numbers 888strings and integers not equal 889strings and integers not equal 890foo 891"10" GEQ "1" 892'1' GEQ 1@or_broken@NT4 8931 GEQ "1" 894"1" GEQ "1" 895'1' GEQ "1" 896"10" GEQ "1" 897non NT4@or_broken@1 GEQ '1' 898'1' GEQ '1' 899foo 9001 GEQ "10" 901foo 902'1' GEQ "10" 903"10" GEQ "10" 904--- unconditional ampersand after if one line 9051@space@ 9062@space@ 9073 else echo 4 908--- 909x@space@ 910--- 911x@space@ 912--- 913x@space@ 914--- 915x@space@ 916--- 917------------ Testing for ------------ 918--- plain FOR 919A 920B 921C 922%I 923%I 924%I 925%j 926%j 927%j 928A 929B 930C 9311 9324 9331 934A 935B 936C 937X 938X2 939X3 940foo 941M 942X 943M 944N 945O 946`echo 947A 948B` 949'echo 950A 951B' 952"echo A B" 953"A B" 954C 955--- imbricated FORs 956X Y 957X Y 958A C 959A D 960B C 961B D 962A C 963A D 964B C 965B D 966--- basic wildcards 967bazbaz 968--- wildcards in subdirs 969pop\bar1@space@ 970pop\bar2.txt@space@ 971pop\bar3@space@ 972--- for /d 973baz@space@ 974foo@space@ 975bar@space@ 976PASSED 977xxx - Should be xxx 978Expected second line 979--- for /R 980Plain directory enumeration 981Plain directory enumeration from provided root 982File enumeration 983File enumeration from provided root 984Mixed enumeration 985Mixed enumeration from provided root 986With duplicates enumeration 987Strip missing wildcards, keep unwildcarded names 988for /R passed 989--- Complex wildcards unix and windows slash 990Windows slashes, valid path 991ASIS: foobar\baz\bazbaz 992WC : foobar\baz\bazbaz 993Windows slashes, invalid path 994ASIS: foobar\jim\bazbaz 995Unix slashes, valid path 996ASIS: foobar/baz/bazbaz 997WC : bazbaz 998Unix slashes, invalid path 999ASIS: foobar/jim/bazbaz 1000Done 1001--- for /L 10021 10033 10045 10051 10063 10075 10080 10092 10101 1011-1 1012ErrorLevel 0 1013ErrorLevel 0 10141 10152 10163 10174 10181 10193 10204 10213 10222 10231 10244 10252 10260 10271 10281 1029-1 1030-1 10311 10323 1033--- rems inside for loops 1034--- ifs inside for loops 1035a1 1036b1 1037d1 1038a2 1039b2 1040d2 1041a3 1042c3 1043d3 1044a4 1045c4 1046d4 1047--- set /a 1048------ individual operations 1049WINE_foo correctly 3 1050WINE_foo correctly -1 1051WINE_foo correctly 3 1052WINE_foo correctly 6 1053WINE_foo correctly 10 1054WINE_foo correctly 4 1055WINE_foo correctly 4 1056WINE_foo correctly -4 1057WINE_foo correctly 0 1058WINE_foo correctly 2 1059WINE_foo correctly 2 1060WINE_foo correctly -2 1061WINE_foo correctly 1 1062WINE_foo correctly 4 1063WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1073741824 [0] 1064WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1073741824 [0] 1065WINE_foo correctly -4 1066WINE_foo correctly 9 1067WINE_foo correctly 2 1068WINE_foo correctly 0 1069WINE_foo correctly -1 1070WINE_foo correctly -3 1071WINE_foo correctly 0 1072WINE_foo correctly 1 1073WINE_foo correctly 1 1074WINE_foo correctly 4 1075WINE_foo correctly 1 1076WINE_foo correctly 5 1077WINE_foo correctly 5 1078WINE_foo correctly 7 1079WINE_foo correctly 5 1080WINE_foo correctly 5 1081WINE_foo correctly 5 1082WINE_foo correctly 4 1083WINE_foo correctly 6 1084WINE_foo correctly 1 1085WINE_foo correctly 4 1086------ precedence and grouping 1087WINE_foo correctly 10 1088WINE_foo correctly 18@or_broken@ERROR: WINE_foo incorrectly [18] 1089WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly 0 [2] 1090WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly [2] 1091WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 4 [0] 1092WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly [4] 1093WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1094WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1095------ octal and hexadecimal 1096WINE_foo correctly 18 1097WINE_foo correctly 18 1098WINE_foo correctly 15 1099WINE_foo correctly 3 1100------ variables 1101WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1102WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1103WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1104WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly [4] 1105WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1106WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1107WINE_baz correctly 4@or_broken@ERROR: WINE_baz incorrectly [4] 1108WINE_foo correctly 9@or_broken@ERROR: WINE_foo incorrectly 3 [9] 1109WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly 3 [9] 1110WINE_foo correctly 0 1111WINE_foo correctly 4 1112WINE_bar correctly 4 1113WINE_foo correctly -7@or_broken@ERROR: WINE_foo incorrectly 4 [-7] 1114WINE_bar correctly -7@or_broken@ERROR: WINE_bar incorrectly 4 [-7] 1115WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly -7 [-1] 1116WINE_bar correctly -1@or_broken@ERROR: WINE_bar incorrectly -7 [-1] 1117WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1118WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly [1] 1119WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly 1 [4] 1120WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly 1 [4] 1121WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 4 [1] 1122WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly 4 [1] 1123WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1 [0] 1124WINE_bar correctly 0@or_broken@ERROR: WINE_bar incorrectly 1 [0] 1125WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1126WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1127WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1128WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1129WINE_foo correctly 19@or_broken@ERROR: WINE_foo incorrectly 0 [19] 1130WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1131WINE_baz correctly 4 1132--- quotes 1133WINE_foo correctly 1 1134WINE_foo correctly 1 1135WINE_foo correctly 1 1136WINE_bar correctly 2 1137WINE_foo correctly 1 1138WINE_bar correctly 2 1139WINE_foo correctly 1 1140WINE_bar correctly 2 1141WINE_foo correctly 1 1142WINE_bar correctly 2 1143WINE_foo correctly 1 1144WINE_bar correctly 2 1145WINE_baz correctly 3 1146WINE_foo correctly 1 1147WINE_bar correctly 2 1148WINE_baz correctly 3 1149WINE_foo correctly 1 1150WINE_bar correctly 2 1151WINE_baz correctly 3 1152WINE_foo correctly 1 1153WINE_bar correctly 2 1154WINE_baz correctly 3 1155WINE_foo correctly 1 1156WINE_bar correctly 2 1157WINE_baz correctly 3 1158WINE_foo correctly 1 1159WINE_foo correctly 1 1160WINE_bar correctly 5 1161WINE_baz correctly 2 1162WINE_foo correctly 18 1163WINE_foo correctly 3 1164WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 4 [7] 1165--- whitespace are ignored between double char operators 1166WINE_foo correctly 10@or_broken@ERROR: WINE_foo incorrectly 4 [10] 1167WINE_bar correctly 50@or_broken@ERROR: WINE_bar incorrectly 5 [50] 1168WINE_foo correctly 772@or_broken@ERROR: WINE_foo incorrectly 4 [772] 1169WINE_bar correctly 7720@or_broken@ERROR: WINE_bar incorrectly 5 [7720] 1170--- invalid operator sequence 11714 11724 1173----- negative prefix 1174WINE_foo correctly -1 1175WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1176WINE_foo correctly 6 1177WINE_foo correctly 0 1178WINE_foo correctly 6 1179WINE_foo correctly 2 1180WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1181WINE_foo correctly 5 1182WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly -5 [3] 1183----- assignment tests involving the end destination 1184WINE_foo correctly 11@or_broken@ERROR: WINE_foo incorrectly 3 [11] 1185WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1186WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly [9] 1187WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1188WINE_bar correctly 10@or_broken@ERROR: WINE_bar incorrectly [10] 1189WINE_baz correctly 7@or_broken@ERROR: WINE_baz incorrectly [7] 1190WINE_foo correctly 7@or_broken@ERROR: WINE_foo incorrectly 2 [7] 1191WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 2 [7] 1192----- equal precedence on stack 1193WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1194WINE_foo correctly 0 1195WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1196WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1197WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1198WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1199WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1200WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1201WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1202WINE_foo correctly -1 1203WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1 [0] 1204WINE_foo correctly 0 1205WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1206WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly 0 [-1] 1207WINE_foo correctly 25@or_broken@ERROR: WINE_foo incorrectly 20 [25] 1208WINE_foo correctly 20 1209WINE_foo correctly 1 1210WINE_foo correctly 4 1211WINE_foo correctly 7 1212WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8] 1213WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6] 1214WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] 1215--- for /F 1216------ string argument 1217a 1218XaX 1219a@or_broken@no output 1220XaX@or_broken@no output 1221a 1222a@or_broken@no output 1223a 1224a@or_broken@no output 1225a 1226a@or_broken@no output 1227a 1228a@or_broken@no output 1229------ fileset argument 1230--------- basic blank handling 1231a 1232a 1233a 1234a 1235a 1236b 1237--------- multi-line with empty lines 1238a 1239b 1240c 1241--------- multiple files 1242a 1243b 1244c 1245q 1246kkk 1247q 1248kkk 1249a 1250b 1251c 1252------ command argument 1253Passed1@or_broken@Missing functionality - Broken1 1254Passed2@or_broken@Missing functionality - Broken2 1255Passed3@or_broken@Missing functionality - Broken3 1256Passed4@or_broken@Missing functionality - Broken4 1257Passed5@or_broken@Missing functionality - Broken5 1258Passed6@or_broken@Missing functionality - Broken6 1259Passed7@or_broken@Missing functionality - Broken7 1260------ eol option 1261and@or_broken@Broken NT4 functionality1 1262Line@or_broken@Broken NT4 functionality2 1263Line@or_broken@Broken NT4 functionality3 1264ad 1265z@y 1266a|d 1267no output 1268no output 1269------ delims option 1270a 1271a@space@ 1272a d 1273a 1274C r 1275foo bar baz 1276c:\ 1277------ skip option 1278c 1279no output 1280no output 1281c 1282c 1283no output 1284------ tokens= option 1285h=%h i=a j=%j k=%k l=%l m=%m o=%o 1286h=%h i=b j=%j k=%k l=%l m=%m o=%o 1287h=%h i=a j=c k=e l=f m=g o=%o 1288h=%h i=a j=e k=f g l=%l m=%m o=%o 1289h=%h i=f j=i k=j k l m n o p q r s t u v w x y z l=%l m=%m o=%o 1290h=%h i=f j=i k=j k l m n;;== o p q r s t u v w x y z l=%l m=%m o=%o 1291h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1292h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1293h=%h i=a j=b k= l= m=%m n=%n o=%o 1294h=%h i=a j=e k=y l=z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z m=%m n=%n o=%o 1295h=%h i=a j=b k= l= m= n=%n o=%o 1296h=%h i=a j=b k= l= m= n= o=%o 1297u=a v=b w=c x=d y=e z=f A=%A a=%a 1298@todo_wine@U=a V=b W=c X=d Y=e Z=f A=%A a=m 1299h=%h i=a j=b k=c l=e m=%m o=%o@or_broken@h=%h i=a j=b k=c l=e m= o=%o 1300h=%h i=e j=%j k=%k l=%l m=%m o=%o 1301h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o@or_broken@h=%h i=a j=b k=c l=d e f g m= n=%n o=%o 1302h=%h i=a j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=a j=c k= l= m= n=%n o=%o 1303h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o 1304h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o 13051:3.14,%B 13062:3.14, 13074:3,14 1308------ parameter splitting 1309:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 1310:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 13114:3.14,%B 13125:3,14 13136:14, 1314------------ Testing del ------------ 1315deleting 'file' 1316errorlevel is 0, good 1317successfully deleted 'file' 1318attempting to delete 'file', even though it is not present 1319errorlevel is 0, good 1320------------ Testing del /a ------------ 1321not-r.test not found after delete, good 1322r.test found before delete, good 1323r.test not found after delete, good 1324------------ Testing del /q ------------ 1325del /q * succeeded on file1 1326del /q * succeeded on file2.dat 1327------------ Testing del /s ------------ 1328------------ Testing rename ------------ 1329--- ren and rename are synonymous 1330foo renamed to bar 1331bar renamed to foo 1332--- name collision 1333foo 1334bar 1335--- rename read-only files 1336read-only file renamed 1337--- rename directories 1338dir renamed 1339read-only dir renamed 1340--- rename in other directory 1341rename impossible in other directory 1342original file still present 1343------------ Testing move ------------ 1344--- file move 1345file move succeeded 1346@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible! 1347@todo_wine@bar@or_broken@baz 1348read-only files are moveable 1349file moved in subdirectory 1350moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op! 1351ErrorLevel: 0@or_broken@ErrorLevel: 1 1352--- directory move 1353simple directory move succeeded 1354moving a directory to itself gives error; errlevel 1 1355------ dir in dir move 1356foo 1357bar2 1358foo2 1359------------ Testing mkdir ------------ 1360--- md and mkdir are synonymous 13610 13620 1363--- creating an already existing directory/file must fail 13641 13651 1366--- multilevel path creation 13670 13680 13690 13700 13710 13721 13730 13740 1375--- trailing backslashes 13760 1377dir created 13780 1379--- invalid chars 1380mkdir ? gives errorlevel 1 1381mkdir ?\foo gives errorlevel 1 1382mkdir foo\? gives errorlevel 1 1383ok, foo created 1384mkdir foo\bar\? gives errorlevel 1 1385ok, foo\bar created 1386--- multiple directories at once 1387foo created 1388bar created 1389foobar created 1390bar\baz created 1391bazbaz created 1392zabzab created 1393mkdir foo\* errorlevel 1 1394ok, foo created 1395------------ Testing rmdir ------------ 13960 1397dir removed 13980 1399dir removed 14000 14010 1402file not removed 14030 1404non-empty dir not removed 14050 1406non-empty dir not removed 1407recursive rmdir succeeded 1408recursive rmdir succeeded 1409foo removed 1410bar removed 1411foobar removed 1412bar\baz removed 1413------------ Testing pushd/popd ------------ 1414@pwd@ 1415--- popd is no-op when dir stack is empty 1416@pwd@ 1417--- pushing non-existing dir 1418@pwd@ 1419--- basic behaviour 1420@drive@@path@foobar 1421@pwd@ 1422@drive@@path@foobar\baz 1423@drive@@path@foobar 1424@drive@@path@foobar 1425@pwd@ 1426@drive@@path@foobar 1427@pwd@ 1428------------ Testing attrib ------------ 1429A@spaces@@drive@@path@foobar\foo@or_broken@A I@spaces@@drive@@path@foobar\foo 1430--- read-only attribute 1431A R@spaces@@drive@@path@foobar\foo@or_broken@A R I@spaces@@drive@@path@foobar\foo 1432foo 1433foo original contents 1434Read-only file not deleted 1435Read-only file forcibly deleted 1436--- recursive behaviour 1437A@spaces@@drive@@path@foobar\baz\level2@or_broken@A I@spaces@@drive@@path@foobar\baz\level2 1438A R@spaces@@drive@@path@foobar\level1@or_broken@A R I@spaces@@drive@@path@foobar\level1 1439A R@spaces@@drive@@path@foobar\baz\level2@or_broken@A R I@spaces@@drive@@path@foobar\baz\level2 1440A@spaces@@drive@@path@foobar\bar@or_broken@A I@spaces@@drive@@path@foobar\bar 1441--- folders processing 1442@spaces@@drive@@path@foobar@or_broken@ I@spaces@@drive@@path@foobar 1443@todo_wine@ R@spaces@@drive@@path@foobar\baz@or_broken@@spaces@@drive@@path@foobar\baz@or_broken@ R I@spaces@@drive@@path@foobar\baz 1444A@spaces@@drive@@path@foobar\baz\toto@or_broken@A I@spaces@@drive@@path@foobar\baz\toto 1445toto 1446lulu 1447file created in read-only dir 1448------------ Testing assoc ------------ 1449--- setting association 1450--- 1451.foo=bar 1452.foo=bar 1453+++ 1454.foo=bar 1455--- resetting association 1456--- 1457+++ 1458--- 1459------------ Testing ftype ------------ 1460--- setting association 1461--- 1462footype=foo_opencmd 1463.foo=footype 1464footype=foo_opencmd 1465+++ 1466footype=foo_opencmd 1467--- resetting association 1468@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO! 1469------------ Testing CALL ------------ 1470--- external script 1471foo@space@ 1472foo 8 1473foo@space@@space@ 1474foo bar@space@ 1475foo ""@space@ 1476"" bar@space@ 1477foo ''@space@ 1478'' bar@space@ 1479--- internal routines 1480bar :testRoutine 1481foo@space@ 1482foo bar 1483foo "" 1484"" bar 1485foo '' 1486'' bar 1487--- with builtins 14880 1489foo created 1490Should expand foobaz 1491batfile 1492robinfile 14931 14941 1495non-builtin dir 1496Line one 1497Line two 1498Get if 1499... and else! 1500passed 1501------------ Testing SHIFT ------------ 1502'p1' 'p2' 'p3' 'p4' 'p5' 1503'p2' 'p3' 'p4' 'p5' '' 1504'p3' 'p4' 'p5' '' '' 1505'p3' 'p5' '' '' '' 1506'p3' 'p5' '' '' '' 1507'p5' '' '' '' '' 1508------------ Testing cmd invocation ------------ 1509--- a batch file can delete itself 1510file correctly deleted 1511--- a batch file can alter itself 1512bar 1513---------- Testing copy 1514Passed: Found expected dummy.file 1515Passed: Found expected dir1\file1 1516Passed: Found expected dir1\file1 1517Passed: Found expected dir1\file99 1518Passed: Found expected file1 1519Passed: Did not find dir2 1520Passed: Did not find dir2\file1 1521Passed: Found expected dir1\file1 1522Passed: Found expected dir1\file2 1523Passed: Found expected dir1\file3 1524Passed: Found expected dir1\file1 1525Passed: Found expected dir1\file2 1526Passed: Found expected dir1\file3 1527Passed: Found expected file1 1528Passed: Found expected file2 1529Passed: Found expected file3 1530Passed: Did not find dir2 1531Passed: Did not find dir2\file1 1532Passed: Did not find dir2\file2 1533Passed: Did not find dir2\file3 1534Passed: Found expected testfile 1535Passed: Found expected testfile 1536Passed: Found expected testfile 1537Passed: Found expected testfile 1538Passed: Found expected testfile 1539Passed: Found expected dir1\fred 1540Passed: Found expected dir1\fred 1541Passed: Found expected fred 1542Passed: Found expected fred 1543Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4 1544Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4 1545Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4 1546Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4 1547Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4 1548Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4 1549Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4 1550Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4 1551Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4 1552Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4 1553Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4 1554Passed: file size check on file1 [24]@or_broken@Skipping file size check on NT4 1555Passed: file size check on file2 [16]@or_broken@Skipping file size check on NT4 1556Passed: file size check on file3 [13]@or_broken@Skipping file size check on NT4 1557Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4 1558Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4 1559Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4 1560Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4 1561Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4 1562Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4 1563Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4 1564Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4 1565Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4 1566Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4 1567Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4 1568Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4 1569Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4 1570Passed: errorlevel invalid check 1 1571Passed: Did not find dir1\file1 1572Passed: errorlevel invalid check 2 1573Passed: errorlevel invalid check 3 1574------------ Testing setlocal/endlocal ------------ 1575--- enable/disable extensions 1576@todo_wine@ErrLev:@space@ 1577ErrLev: 0 1578ErrLev: 0 1579@todo_wine@ErrLev:@space@@or_broken@ErrLev: 0 1580ErrLev: 0 1581--- setlocal with corresponding endlocal 1582globalval 1583localval 1584@drive@@path@foobar\foobar2 1585globalval 1586@drive@@path@foobar 1587globalval 1588@drive@@path@foobar 1589--- setlocal with no corresponding endlocal 1590globalval 1591localval 1592@drive@@path@foobar\foobar2 1593globalval 1594@drive@@path@foobar 1595--- setlocal within same batch program 1596Var1 ok 1 1597Var2 ok 2 1598Var3 ok 3 1599Directory is ok 1 1600Var1 ok 1 1601Var2 ok 2 1602Var3 ok 3 1603Directory is ok 2 1604Var1 ok 1 1605Var2 ok 2 1606Var3 ok 3 1607Directory is ok 3 1608--- Mismatched set and end locals 1609--- Extra setlocal in called batch 1610value2 16112set1endvalue1 1612@drive@@path@foobar\foodir3 1613Finished: 1614value2 1615@drive@@path@foobar\foodir2 1616value1 1617@drive@@path@foobar 1618--- Extra endlocal in called batch 1619value2 1620value2 1621@drive@@path@foobar\foodir2 1622value2 1623@drive@@path@foobar\foodir2 1624Finished: 1625value2 1626@drive@@path@foobar\foodir2 1627value1 1628@drive@@path@foobar 1629--- endlocal in called function rather than batch pgm is ineffective 16302 16312 16321 16332 16341 16352 16361 16371 1638------------ Testing Errorlevel ------------ 16399009 16401 1641errorlevel just right, good 1642errorlevel with leading zero just right, good 1643errorlevel with negative number OK 1644abc0def@or_broken@abc1def 1645errorlevel zero, good@or_broken@errorlevel nonzero, bad 16467 should be 7 16477 should still be 7 1648------------ Testing GOTO ------------ 1649goto with no leading space worked 1650goto with colon and no leading space worked 1651goto with a leading space worked 1652goto with a leading tab worked 1653goto with a following space worked 1654goto with following amphersands worked 1655goto with redirections worked 1656Ignoring double colons worked 1657label with mixed whitespace and no echo worked 1658Correctly ignored trailing information 1659Begin: 1660..First sub 1661..First sub 1662Middle: 1663..Third sub 1664..Third sub 1665Near end: 1666..Fourth sub 1667..Fourth sub 1668At end: 1669..First sub 1670..First sub 1671Finished 1672------------ Testing PATH ------------ 1673PATH=original 1674PATH=try2 1675PATH=try3 1676------------ Testing start /W ------------ 1677start /W seems to really wait 1678------------ Testing changing the drive letter ---------- 1679Normal: 1680Normal+space 1681Normal+space+garbage 1682Quoted should fail 1683Normal+tab 1684Normal+tab+garbage 1685------------ Testing combined CALLs/GOTOs ------------ 1686world 1687cheball 1688barbare 1689bar 1690foo 1691baz 1692cheball 1693barbare 1694