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------------ Testing NUL ------------ 663bar 664bar 665bar 666NUL 667foo created 668Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 669Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 670Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 671Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 672Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 673Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on NT4 674------------ Testing if/else ------------ 675--- if/else should work with blocks 676if seems to work 677else seems to work 678if seems not to detect /c as parameter 679else if seems to work 680else if seems to work 681else if seems to work 682expected1 683expected post-embedded if 684--- case sensitivity with and without /i option 685if seems to default to case sensitivity 686if /i seems to work 687if /I seems to work 688--- string comparisons 689equal 690non equal 691non equal 692equal 693--- tabs handling 694doom 695doom 696doom 697lol 698quake 699quake 700quake 701--- comparison operators 702------ for strings 703LSS string can be used as operand for LSS comparison 704floats are handled as strings 705numbers in quotes are handled as strings 706negative numbers as well@or_broken@NT4 707if /i seems to work for LSS 708A LSS B 709A LSS AB 710A LSS BA 711A LSS AA 712B LSS BA 713AB LSS B 714AB LSS BA 715AA LSS B 716AA LSS AB 717AA LSS BA 718b LSS B@or_broken@NT4 719a LSS B@or_broken@NT4 720a LSS B insensitive 721A LSS b 722A LSS b insensitive 723A LEQ A 724A LEQ B 725A LEQ AB 726A LEQ BA 727A LEQ AA 728B LEQ B 729B LEQ BA 730AB LEQ B 731AB LEQ AB 732AB LEQ BA 733BA LEQ BA 734AA LEQ B 735AA LEQ AB 736AA LEQ BA 737AA LEQ AA 738b LEQ B@or_broken@NT4 739b LEQ B insensitive 740a LEQ B@or_broken@NT4 741a LEQ B insensitive 742A LEQ b 743A LEQ b insensitive 744A EQU A 745B EQU B 746AB EQU AB 747BA EQU BA 748AA EQU AA 749A EQU a insensitive 750A NEQ B 751A NEQ AB 752A NEQ BA 753A NEQ AA 754B NEQ A 755B NEQ AB 756B NEQ BA 757B NEQ AA 758AB NEQ A 759AB NEQ B 760AB NEQ BA 761AB NEQ AA 762BA NEQ A 763BA NEQ B 764BA NEQ AB 765BA NEQ AA 766AA NEQ A 767AA NEQ B 768AA NEQ AB 769AA NEQ BA 770A GEQ A 771B GEQ A 772B GEQ B 773B GEQ AB 774B GEQ AA 775AB GEQ A 776AB GEQ AB 777AB GEQ AA 778BA GEQ A 779BA GEQ B 780BA GEQ AB 781BA GEQ BA 782BA GEQ AA 783AA GEQ A 784AA GEQ AA 785B GTR A 786B GTR AB 787B GTR AA 788AB GTR A 789AB GTR AA 790BA GTR A 791BA GTR B 792BA GTR AB 793BA GTR AA 794AA GTR A 795------------ Testing if/exist ------------ 796exist explicit works 797exist explicit unknown file works 798exist explicit in subdir works 799exist simple wildcard works 800exist wildcard works 801negate exist wildcard works 802exist wildcard bad subdir broken works 803exist subdir ok 804exist subdir with . ok 805exist subdir with \ ok 806exist subdir with \ and quotes ok 807------ for numbers 808negative numbers handled 809negative numbers handled 810octal handled 811also in negative form 812hexa handled 813also in negative form 81411 LSS 101 8150 LSS 1 8160 LSS 10 8170 LSS 9 8181 LSS 10 8191 LSS 9 8209 LSS 10 8210 LEQ 0 8220 LEQ 1 8230 LEQ 10 8240 LEQ 9 8251 LEQ 1 8261 LEQ 10 8271 LEQ 9 82810 LEQ 10 8299 LEQ 10 8309 LEQ 9 8310 EQU 0 8321 EQU 1 83310 EQU 10 8349 EQU 9 835octal ok 836hexa ok 837string/hexa compare ok 838string/hexa compare ok 8390 NEQ 1 8400 NEQ 10 8410 NEQ 9 8421 NEQ 0 8431 NEQ 10 8441 NEQ 9 84510 NEQ 0 84610 NEQ 1 84710 NEQ 9 8489 NEQ 0 8499 NEQ 1 8509 NEQ 10 8510 GEQ 0 8521 GEQ 0 8531 GEQ 1 85410 GEQ 0 85510 GEQ 1 85610 GEQ 10 85710 GEQ 9 8589 GEQ 0 8599 GEQ 1 8609 GEQ 9 8611 GTR 0 86210 GTR 0 86310 GTR 1 86410 GTR 9 8659 GTR 0 8669 GTR 1 867------ for numbers and stringified numbers 868strings and integers not equal 869strings and integers not equal 870foo 871"10" GEQ "1" 872'1' GEQ 1@or_broken@NT4 8731 GEQ "1" 874"1" GEQ "1" 875'1' GEQ "1" 876"10" GEQ "1" 877non NT4@or_broken@1 GEQ '1' 878'1' GEQ '1' 879foo 8801 GEQ "10" 881foo 882'1' GEQ "10" 883"10" GEQ "10" 884--- unconditional ampersand after if one line 8851@space@ 8862@space@ 8873 else echo 4 888--- 889x@space@ 890--- 891x@space@ 892--- 893x@space@ 894--- 895x@space@ 896--- 897------------ Testing for ------------ 898--- plain FOR 899A 900B 901C 902%I 903%I 904%I 905%j 906%j 907%j 908A 909B 910C 9111 9124 9131 914A 915B 916C 917X 918X2 919X3 920foo 921M 922X 923M 924N 925O 926`echo 927A 928B` 929'echo 930A 931B' 932"echo A B" 933"A B" 934C 935--- imbricated FORs 936X Y 937X Y 938A C 939A D 940B C 941B D 942A C 943A D 944B C 945B D 946--- basic wildcards 947bazbaz 948--- wildcards in subdirs 949pop\bar1@space@ 950pop\bar2.txt@space@ 951pop\bar3@space@ 952--- for /d 953baz@space@ 954foo@space@ 955bar@space@ 956PASSED 957xxx - Should be xxx 958Expected second line 959--- for /R 960Plain directory enumeration 961Plain directory enumeration from provided root 962File enumeration 963File enumeration from provided root 964Mixed enumeration 965Mixed enumeration from provided root 966With duplicates enumeration 967Strip missing wildcards, keep unwildcarded names 968for /R passed 969--- Complex wildcards unix and windows slash 970Windows slashes, valid path 971ASIS: foobar\baz\bazbaz 972WC : foobar\baz\bazbaz 973Windows slashes, invalid path 974ASIS: foobar\jim\bazbaz 975Unix slashes, valid path 976ASIS: foobar/baz/bazbaz 977WC : bazbaz 978Unix slashes, invalid path 979ASIS: foobar/jim/bazbaz 980Done 981--- for /L 9821 9833 9845 9851 9863 9875 9880 9892 9901 991-1 992ErrorLevel 0 993ErrorLevel 0 9941 9952 9963 9974 9981 9993 10004 10013 10022 10031 10044 10052 10060 10071 10081 1009-1 1010-1 10111 10123 1013--- rems inside for loops 1014--- ifs inside for loops 1015a1 1016b1 1017d1 1018a2 1019b2 1020d2 1021a3 1022c3 1023d3 1024a4 1025c4 1026d4 1027--- set /a 1028------ individual operations 1029WINE_foo correctly 3 1030WINE_foo correctly -1 1031WINE_foo correctly 3 1032WINE_foo correctly 6 1033WINE_foo correctly 10 1034WINE_foo correctly 4 1035WINE_foo correctly 4 1036WINE_foo correctly -4 1037WINE_foo correctly 0 1038WINE_foo correctly 2 1039WINE_foo correctly 2 1040WINE_foo correctly -2 1041WINE_foo correctly 1 1042WINE_foo correctly 4 1043WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1073741824 [0] 1044WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1073741824 [0] 1045WINE_foo correctly -4 1046WINE_foo correctly 9 1047WINE_foo correctly 2 1048WINE_foo correctly 0 1049WINE_foo correctly -1 1050WINE_foo correctly -3 1051WINE_foo correctly 0 1052WINE_foo correctly 1 1053WINE_foo correctly 1 1054WINE_foo correctly 4 1055WINE_foo correctly 1 1056WINE_foo correctly 5 1057WINE_foo correctly 5 1058WINE_foo correctly 7 1059WINE_foo correctly 5 1060WINE_foo correctly 5 1061WINE_foo correctly 5 1062WINE_foo correctly 4 1063WINE_foo correctly 6 1064WINE_foo correctly 1 1065WINE_foo correctly 4 1066------ precedence and grouping 1067WINE_foo correctly 10 1068WINE_foo correctly 18@or_broken@ERROR: WINE_foo incorrectly [18] 1069WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly 0 [2] 1070WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly [2] 1071WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 4 [0] 1072WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly [4] 1073WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1074WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1075------ octal and hexadecimal 1076WINE_foo correctly 18 1077WINE_foo correctly 18 1078WINE_foo correctly 15 1079WINE_foo correctly 3 1080------ variables 1081WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1082WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1083WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1084WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly [4] 1085WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1086WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1087WINE_baz correctly 4@or_broken@ERROR: WINE_baz incorrectly [4] 1088WINE_foo correctly 9@or_broken@ERROR: WINE_foo incorrectly 3 [9] 1089WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly 3 [9] 1090WINE_foo correctly 0 1091WINE_foo correctly 4 1092WINE_bar correctly 4 1093WINE_foo correctly -7@or_broken@ERROR: WINE_foo incorrectly 4 [-7] 1094WINE_bar correctly -7@or_broken@ERROR: WINE_bar incorrectly 4 [-7] 1095WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly -7 [-1] 1096WINE_bar correctly -1@or_broken@ERROR: WINE_bar incorrectly -7 [-1] 1097WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1098WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly [1] 1099WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly 1 [4] 1100WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly 1 [4] 1101WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 4 [1] 1102WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly 4 [1] 1103WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1 [0] 1104WINE_bar correctly 0@or_broken@ERROR: WINE_bar incorrectly 1 [0] 1105WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1106WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1107WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1108WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1109WINE_foo correctly 19@or_broken@ERROR: WINE_foo incorrectly 0 [19] 1110WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1111WINE_baz correctly 4 1112--- quotes 1113WINE_foo correctly 1 1114WINE_foo correctly 1 1115WINE_foo correctly 1 1116WINE_bar correctly 2 1117WINE_foo correctly 1 1118WINE_bar correctly 2 1119WINE_foo correctly 1 1120WINE_bar correctly 2 1121WINE_foo correctly 1 1122WINE_bar correctly 2 1123WINE_foo correctly 1 1124WINE_bar correctly 2 1125WINE_baz correctly 3 1126WINE_foo correctly 1 1127WINE_bar correctly 2 1128WINE_baz correctly 3 1129WINE_foo correctly 1 1130WINE_bar correctly 2 1131WINE_baz correctly 3 1132WINE_foo correctly 1 1133WINE_bar correctly 2 1134WINE_baz correctly 3 1135WINE_foo correctly 1 1136WINE_bar correctly 2 1137WINE_baz correctly 3 1138WINE_foo correctly 1 1139WINE_foo correctly 1 1140WINE_bar correctly 5 1141WINE_baz correctly 2 1142WINE_foo correctly 18 1143WINE_foo correctly 3 1144WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 4 [7] 1145--- whitespace are ignored between double char operators 1146WINE_foo correctly 10@or_broken@ERROR: WINE_foo incorrectly 4 [10] 1147WINE_bar correctly 50@or_broken@ERROR: WINE_bar incorrectly 5 [50] 1148WINE_foo correctly 772@or_broken@ERROR: WINE_foo incorrectly 4 [772] 1149WINE_bar correctly 7720@or_broken@ERROR: WINE_bar incorrectly 5 [7720] 1150--- invalid operator sequence 11514 11524 1153----- negative prefix 1154WINE_foo correctly -1 1155WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1156WINE_foo correctly 6 1157WINE_foo correctly 0 1158WINE_foo correctly 6 1159WINE_foo correctly 2 1160WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1161WINE_foo correctly 5 1162WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly -5 [3] 1163----- assignment tests involving the end destination 1164WINE_foo correctly 11@or_broken@ERROR: WINE_foo incorrectly 3 [11] 1165WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1166WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly [9] 1167WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1168WINE_bar correctly 10@or_broken@ERROR: WINE_bar incorrectly [10] 1169WINE_baz correctly 7@or_broken@ERROR: WINE_baz incorrectly [7] 1170WINE_foo correctly 7@or_broken@ERROR: WINE_foo incorrectly 2 [7] 1171WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 2 [7] 1172----- equal precedence on stack 1173WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1174WINE_foo correctly 0 1175WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1176WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1177WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1178WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1179WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1180WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1181WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1182WINE_foo correctly -1 1183WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1 [0] 1184WINE_foo correctly 0 1185WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1186WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly 0 [-1] 1187WINE_foo correctly 25@or_broken@ERROR: WINE_foo incorrectly 20 [25] 1188WINE_foo correctly 20 1189WINE_foo correctly 1 1190WINE_foo correctly 4 1191WINE_foo correctly 7 1192WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8] 1193WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6] 1194WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] 1195--- for /F 1196------ string argument 1197a 1198XaX 1199a@or_broken@no output 1200XaX@or_broken@no output 1201a 1202a@or_broken@no output 1203a 1204a@or_broken@no output 1205a 1206a@or_broken@no output 1207a 1208a@or_broken@no output 1209------ fileset argument 1210--------- basic blank handling 1211a 1212a 1213a 1214a 1215a 1216b 1217--------- multi-line with empty lines 1218a 1219b 1220c 1221--------- multiple files 1222a 1223b 1224c 1225q 1226kkk 1227q 1228kkk 1229a 1230b 1231c 1232------ command argument 1233Passed1@or_broken@Missing functionality - Broken1 1234Passed2@or_broken@Missing functionality - Broken2 1235Passed3@or_broken@Missing functionality - Broken3 1236Passed4@or_broken@Missing functionality - Broken4 1237Passed5@or_broken@Missing functionality - Broken5 1238Passed6@or_broken@Missing functionality - Broken6 1239Passed7@or_broken@Missing functionality - Broken7 1240------ eol option 1241and@or_broken@Broken NT4 functionality1 1242Line@or_broken@Broken NT4 functionality2 1243Line@or_broken@Broken NT4 functionality3 1244ad 1245z@y 1246a|d 1247no output 1248no output 1249------ delims option 1250a 1251a@space@ 1252a d 1253a 1254C r 1255foo bar baz 1256c:\ 1257------ skip option 1258c 1259no output 1260no output 1261c 1262c 1263no output 1264------ tokens= option 1265h=%h i=a j=%j k=%k l=%l m=%m o=%o 1266h=%h i=b j=%j k=%k l=%l m=%m o=%o 1267h=%h i=a j=c k=e l=f m=g o=%o 1268h=%h i=a j=e k=f g l=%l m=%m o=%o 1269h=%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 1270h=%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 1271h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1272h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1273h=%h i=a j=b k= l= m=%m n=%n o=%o 1274h=%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 1275h=%h i=a j=b k= l= m= n=%n o=%o 1276h=%h i=a j=b k= l= m= n= o=%o 1277u=a v=b w=c x=d y=e z=f A=%A a=%a 1278@todo_wine@U=a V=b W=c X=d Y=e Z=f A=%A a=m 1279h=%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 1280h=%h i=e j=%j k=%k l=%l m=%m o=%o 1281h=%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 1282h=%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 1283h=%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 1284h=%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 12851:3.14,%B 12862:3.14, 12874:3,14 1288------ parameter splitting 1289:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 1290:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 12914:3.14,%B 12925:3,14 12936:14, 1294------------ Testing del ------------ 1295deleting 'file' 1296errorlevel is 0, good 1297successfully deleted 'file' 1298attempting to delete 'file', even though it is not present 1299errorlevel is 0, good 1300------------ Testing del /a ------------ 1301not-r.test not found after delete, good 1302r.test found before delete, good 1303r.test not found after delete, good 1304------------ Testing del /q ------------ 1305del /q * succeeded on file1 1306del /q * succeeded on file2.dat 1307------------ Testing del /s ------------ 1308------------ Testing rename ------------ 1309--- ren and rename are synonymous 1310foo renamed to bar 1311bar renamed to foo 1312--- name collision 1313foo 1314bar 1315--- rename read-only files 1316read-only file renamed 1317--- rename directories 1318dir renamed 1319read-only dir renamed 1320--- rename in other directory 1321rename impossible in other directory 1322original file still present 1323------------ Testing move ------------ 1324--- file move 1325file move succeeded 1326@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible! 1327@todo_wine@bar@or_broken@baz 1328read-only files are moveable 1329file moved in subdirectory 1330moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op! 1331ErrorLevel: 0@or_broken@ErrorLevel: 1 1332--- directory move 1333simple directory move succeeded 1334moving a directory to itself gives error; errlevel 1 1335------ dir in dir move 1336foo 1337bar2 1338foo2 1339------------ Testing mkdir ------------ 1340--- md and mkdir are synonymous 13410 13420 1343--- creating an already existing directory/file must fail 13441 13451 1346--- multilevel path creation 13470 13480 13490 13500 13510 13521 13530 13540 1355--- trailing backslashes 13560 1357dir created 13580 1359--- invalid chars 1360mkdir ? gives errorlevel 1 1361mkdir ?\foo gives errorlevel 1 1362mkdir foo\? gives errorlevel 1 1363ok, foo created 1364mkdir foo\bar\? gives errorlevel 1 1365ok, foo\bar created 1366--- multiple directories at once 1367foo created 1368bar created 1369foobar created 1370bar\baz created 1371bazbaz created 1372zabzab created 1373mkdir foo\* errorlevel 1 1374ok, foo created 1375------------ Testing rmdir ------------ 13760 1377dir removed 13780 1379dir removed 13800 13810 1382file not removed 13830 1384non-empty dir not removed 13850 1386non-empty dir not removed 1387recursive rmdir succeeded 1388recursive rmdir succeeded 1389foo removed 1390bar removed 1391foobar removed 1392bar\baz removed 1393------------ Testing pushd/popd ------------ 1394@pwd@ 1395--- popd is no-op when dir stack is empty 1396@pwd@ 1397--- pushing non-existing dir 1398@pwd@ 1399--- basic behaviour 1400@drive@@path@foobar 1401@pwd@ 1402@drive@@path@foobar\baz 1403@drive@@path@foobar 1404@drive@@path@foobar 1405@pwd@ 1406@drive@@path@foobar 1407@pwd@ 1408------------ Testing attrib ------------ 1409A@spaces@@drive@@path@foobar\foo@or_broken@A I@spaces@@drive@@path@foobar\foo 1410--- read-only attribute 1411A R@spaces@@drive@@path@foobar\foo@or_broken@A R I@spaces@@drive@@path@foobar\foo 1412foo 1413foo original contents 1414Read-only file not deleted 1415Read-only file forcibly deleted 1416--- recursive behaviour 1417A@spaces@@drive@@path@foobar\baz\level2@or_broken@A I@spaces@@drive@@path@foobar\baz\level2 1418A R@spaces@@drive@@path@foobar\level1@or_broken@A R I@spaces@@drive@@path@foobar\level1 1419A R@spaces@@drive@@path@foobar\baz\level2@or_broken@A R I@spaces@@drive@@path@foobar\baz\level2 1420A@spaces@@drive@@path@foobar\bar@or_broken@A I@spaces@@drive@@path@foobar\bar 1421--- folders processing 1422@spaces@@drive@@path@foobar@or_broken@ I@spaces@@drive@@path@foobar 1423@todo_wine@ R@spaces@@drive@@path@foobar\baz@or_broken@@spaces@@drive@@path@foobar\baz@or_broken@ R I@spaces@@drive@@path@foobar\baz 1424A@spaces@@drive@@path@foobar\baz\toto@or_broken@A I@spaces@@drive@@path@foobar\baz\toto 1425toto 1426lulu 1427file created in read-only dir 1428------------ Testing assoc ------------ 1429--- setting association 1430--- 1431.foo=bar 1432.foo=bar 1433+++ 1434.foo=bar 1435--- resetting association 1436--- 1437+++ 1438--- 1439------------ Testing ftype ------------ 1440--- setting association 1441--- 1442footype=foo_opencmd 1443.foo=footype 1444footype=foo_opencmd 1445+++ 1446footype=foo_opencmd 1447--- resetting association 1448@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO! 1449------------ Testing CALL ------------ 1450--- external script 1451foo@space@ 1452foo 8 1453foo@space@@space@ 1454foo bar@space@ 1455foo ""@space@ 1456"" bar@space@ 1457foo ''@space@ 1458'' bar@space@ 1459--- internal routines 1460bar :testRoutine 1461foo@space@ 1462foo bar 1463foo "" 1464"" bar 1465foo '' 1466'' bar 1467--- with builtins 14680 1469foo created 1470Should expand foobaz 1471batfile 1472robinfile 14731 14741 1475non-builtin dir 1476Line one 1477Line two 1478Get if 1479... and else! 1480passed 1481------------ Testing SHIFT ------------ 1482'p1' 'p2' 'p3' 'p4' 'p5' 1483'p2' 'p3' 'p4' 'p5' '' 1484'p3' 'p4' 'p5' '' '' 1485'p3' 'p5' '' '' '' 1486'p3' 'p5' '' '' '' 1487'p5' '' '' '' '' 1488------------ Testing cmd invocation ------------ 1489--- a batch file can delete itself 1490file correctly deleted 1491--- a batch file can alter itself 1492bar 1493---------- Testing copy 1494Passed: Found expected dummy.file 1495Passed: Found expected dir1\file1 1496Passed: Found expected dir1\file1 1497Passed: Found expected dir1\file99 1498Passed: Found expected file1 1499Passed: Did not find dir2 1500Passed: Did not find dir2\file1 1501Passed: Found expected dir1\file1 1502Passed: Found expected dir1\file2 1503Passed: Found expected dir1\file3 1504Passed: Found expected dir1\file1 1505Passed: Found expected dir1\file2 1506Passed: Found expected dir1\file3 1507Passed: Found expected file1 1508Passed: Found expected file2 1509Passed: Found expected file3 1510Passed: Did not find dir2 1511Passed: Did not find dir2\file1 1512Passed: Did not find dir2\file2 1513Passed: Did not find dir2\file3 1514Passed: Found expected testfile 1515Passed: Found expected testfile 1516Passed: Found expected testfile 1517Passed: Found expected testfile 1518Passed: Found expected testfile 1519Passed: Found expected dir1\fred 1520Passed: Found expected dir1\fred 1521Passed: Found expected fred 1522Passed: Found expected fred 1523Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4 1524Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4 1525Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4 1526Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4 1527Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4 1528Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4 1529Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4 1530Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4 1531Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4 1532Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4 1533Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4 1534Passed: file size check on file1 [24]@or_broken@Skipping file size check on NT4 1535Passed: file size check on file2 [16]@or_broken@Skipping file size check on NT4 1536Passed: file size check on file3 [13]@or_broken@Skipping file size check on NT4 1537Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4 1538Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4 1539Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4 1540Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4 1541Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4 1542Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4 1543Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4 1544Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4 1545Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4 1546Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4 1547Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4 1548Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4 1549Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4 1550Passed: errorlevel invalid check 1 1551Passed: Did not find dir1\file1 1552Passed: errorlevel invalid check 2 1553Passed: errorlevel invalid check 3 1554------------ Testing setlocal/endlocal ------------ 1555--- enable/disable extensions 1556@todo_wine@ErrLev:@space@ 1557ErrLev: 0 1558ErrLev: 0 1559@todo_wine@ErrLev:@space@@or_broken@ErrLev: 0 1560ErrLev: 0 1561--- setlocal with corresponding endlocal 1562globalval 1563localval 1564@drive@@path@foobar\foobar2 1565globalval 1566@drive@@path@foobar 1567globalval 1568@drive@@path@foobar 1569--- setlocal with no corresponding endlocal 1570globalval 1571localval 1572@drive@@path@foobar\foobar2 1573globalval 1574@drive@@path@foobar 1575--- setlocal within same batch program 1576Var1 ok 1 1577Var2 ok 2 1578Var3 ok 3 1579Directory is ok 1 1580Var1 ok 1 1581Var2 ok 2 1582Var3 ok 3 1583Directory is ok 2 1584Var1 ok 1 1585Var2 ok 2 1586Var3 ok 3 1587Directory is ok 3 1588--- Mismatched set and end locals 1589--- Extra setlocal in called batch 1590value2 15912set1endvalue1 1592@drive@@path@foobar\foodir3 1593Finished: 1594value2 1595@drive@@path@foobar\foodir2 1596value1 1597@drive@@path@foobar 1598--- Extra endlocal in called batch 1599value2 1600value2 1601@drive@@path@foobar\foodir2 1602value2 1603@drive@@path@foobar\foodir2 1604Finished: 1605value2 1606@drive@@path@foobar\foodir2 1607value1 1608@drive@@path@foobar 1609--- endlocal in called function rather than batch pgm is ineffective 16102 16112 16121 16132 16141 16152 16161 16171 1618------------ Testing Errorlevel ------------ 16199009 16201 1621errorlevel just right, good 1622errorlevel with leading zero just right, good 1623errorlevel with negative number OK 1624abc0def@or_broken@abc1def 1625errorlevel zero, good@or_broken@errorlevel nonzero, bad 16267 should be 7 16277 should still be 7 1628------------ Testing GOTO ------------ 1629goto with no leading space worked 1630goto with colon and no leading space worked 1631goto with a leading space worked 1632goto with a leading tab worked 1633goto with a following space worked 1634goto with following amphersands worked 1635goto with redirections worked 1636Ignoring double colons worked 1637label with mixed whitespace and no echo worked 1638Correctly ignored trailing information 1639Begin: 1640..First sub 1641..First sub 1642Middle: 1643..Third sub 1644..Third sub 1645Near end: 1646..Fourth sub 1647..Fourth sub 1648At end: 1649..First sub 1650..First sub 1651Finished 1652------------ Testing PATH ------------ 1653PATH=original 1654PATH=try2 1655PATH=try3 1656------------ Testing start /W ------------ 1657start /W seems to really wait 1658------------ Testing changing the drive letter ---------- 1659Normal: 1660Normal+space 1661Normal+space+garbage 1662Quoted should fail 1663Normal+tab 1664Normal+tab+garbage 1665------------ Testing combined CALLs/GOTOs ------------ 1666world 1667cheball 1668barbare 1669bar 1670foo 1671baz 1672cheball 1673barbare 1674