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 208@todo_wine@foo1 209----- 210foo2 211foo3 212file does not exist, ok 213foo4 214baz5 215baz6@space@ 216baz7 217baz8 218baz 219foo@space@ 220baz 221foo 222A 223B 224C 225------------ Testing circumflex escape character ------------ 226hello, world 227hello, world 228hell^o, world 229hell^o, world 230helloworld 231hello 232world 233hello 234 235finished 236baz 237baz 238foo | echo bar 239foo & echo bar 240bak & 241baz@space@ 2420@or_broken@1 243foo > foo 244< 245ffoof 246WINE_FOO=bar | baz 2470 248WINE_FOO=bar ^| baz 249bar | baz 2500 251------------ Testing chains ------------ 252--- chain success 253a1 254a2 255b1 256b2 257c1 258@todo_wine@--- 259d1 260d2 261d3 262e1 263e2 264e3 265f1 266f2 267@todo_wine@--- 268g1 269g2 270g3 271h1 272h2 273h3 274i1 275i2 276@todo_wine@--- 277j1 278@todo_wine@j3 279@todo_wine@--- 280k1 281@todo_wine@--- 282l1 283@todo_wine@--- 284--- chain failure 285a1 286a2 287b1 288@todo_wine@--- 289c1 290c2 291d1 292d2 293d3 294e1 295e2 296@todo_wine@--- 297f1 298f2 299f3 300g1 301@todo_wine@g3 302@todo_wine@--- 303h1 304@todo_wine@--- 305i1 306@todo_wine@i3 307@todo_wine@--- 308j1 309j2 310j3 311k1 312k2 313@todo_wine@--- 314l1 315l2 316l3 317--- chain brackets 318a1 319a2 320a3 321b1 322b2 323b3 324c1 325c2 326@todo_wine@--- 327d1 328d2 329d3 330e1 331e2 332e3 333f1 334f2 335@todo_wine@--- 336g1 337@todo_wine@--- 338h1 339@todo_wine@--- 340i1 341@todo_wine@--- 342j1 343j2 344j3 345k1 346k2 347@todo_wine@--- 348l1 349l2 350l3 351m1 352@todo_wine@--- 353n1 354@todo_wine@--- 355o1 356@todo_wine@--- 357p1 358p2 359p3 360q1 361q2 362@todo_wine@--- 363r1 364r2 365r3 366--- chain pipe 367@todo_wine@a@space@ 368@todo_wine@a@space@ 369--- 370b2 371c1 372c3 373d1 374@todo_wine@--- 375e1 376e3 377f2 378f3 379g2 380@todo_wine@--- 381h2 382h3 383i3 384--- chain pipe input 385a2:[a1,a2] 386b3:[b2:[b1,b2],b3]@or_broken@b3:[b2:,b3] 387c4:[c3:[c2:[c1,c2],c3],c4]@or_broken@c4:[c3:[c2:,c3],c4]@or_broken@c4:[c3:,c4] 388d2:[d1,d2] 389e3:[e2:[e1,e2],e3]@or_broken@e3:[e2:,e3] 390f4:[f3:[f2:[f1,f2],f3],f4]@or_broken@f4:[f3:[f2:,f3],f4]@or_broken@f4:[f3:,f4] 391--- chain else 392a1 393b2 394@todo_wine@--- 395@todo_wine@c3 396@todo_wine@--- 397@todo_wine@d3 398@todo_wine@--- 399@todo_wine@--- 400@todo_wine@--- 401@todo_wine@--- 402@todo_wine@--- 403--- chain else (if true) 404a1 else echo a2 405b2 else echo b3 406c1 407c2 else echo c3 408d1 409@todo_wine@--- 410e1 411e2 else echo e3 412f3 413g1 else echo g2 414g3 415h1 else echo h2 416@todo_wine@--- 417i1 else echo i2 418i3 419@todo_wine@j2@space@ 420@todo_wine@--- 421k1 422k2 423l1 424@todo_wine@--- 425m1 426m2 427n1 428o1 429p1 430q1 431--- chain else (if false) 432@todo_wine@j3 433--- 434k3 435l3 436m3 437n3 438o2 439o3 440p2 441@todo_wine@--- 442q2 443q3 444------------ Testing 'set' ------------ 4451 4460 447WINE_FOOBAR not defined 448 baz 449WINE_FOOBAR = baz 4500 451 baz2 4520 453 bar 454WINE_FOOBAR= bar 455WINE_FOOBAR = baz2 456WINE_FOOBAR = baz2 457WINE_FOOBAR not defined 4581 459bar 460foobar 461WINE_FOO not defined 462WINE_BAZ=bazbaz 463bazbaz 464set "WINE_FOO=bar" should not include the quotes in the variable value 465bar 466foo 467'' 468'foo@space@' 469'foo@tab@' 470'value@space@' 471'value' 472'jim fred' 473'"jim" fred' 474'jim fred' 475'jim' 476'apple"banana"grape' 477------------ Testing variable expansion ------------ 478~p0 should be path containing batch file 479@path@ 480@path@ 481~dp0 should be directory containing batch file 482@drive@@path@ 483@drive@@path@ 484CD value @pwd@@or_broken@CD value@space@ 485% 486P 487P 488S 489P 490PS 491ERRORLEVEL 4920 49300 4940ERRORLEVEL 4950 4960% 497P0 4980S 499P0S 500------------ Testing variable substrings ------------ 501q 502qwe 503er 504'ty'@or_broken@'' 505't'@or_broken@'' 506ert@or_broken@qwerty 507e@or_broken@qwerty 508''@or_broken@'qwerty' 509r@or_broken@qwerty 510------------ Testing variable substitution ------------ 511--- in FOR variables 512"A B" 513C 514"A B" 515C 516'A B'@or_broken@'' 517'C'@or_broken@'' 518@drive@@path@C D@or_broken@%~ff 519@drive@@path@E@or_broken@%~ff 520@drive@ 521@drive@ 522@path@@or_broken@%~pd 523@path@@or_broken@%~pd 524L M 525N 526'.OOL' 527'.TABC' 528'' 529@todo_wine@'@drive@@shortpath@R S'@or_broken@'' 530@todo_wine@'@drive@@shortpath@T'@or_broken@'' 531@todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' 532''@or_broken@'%~ai' 533''@or_broken@'%~ai' 534'--a------'@or_broken@'--a--------'@or_broken@'--a--c---'@or_broken@'%~ai' 535'5'@or_broken@'%~zi' 536''@or_broken@'%~ti' 537''@or_broken@'%~ti' 538''@or_broken@'%~zi' 539''@or_broken@'%~zi' 540@drive@@path@ 541@drive@@path@ 542@drive@ 543@drive@ 544@drive@ 545@drive@ 546'' 547'.eh' 548',,,,,,,,,' 549--- in parameters 550"A B" 551C 552'A B'@or_broken@'' 553'C'@or_broken@'' 554@drive@@path@C D 555@drive@@path@E 556@drive@ 557@drive@ 558@path@ 559@path@ 560L M 561N 562'.OOL' 563'.TABC' 564'' 565@todo_wine@'@drive@@shortpath@R S'@or_broken@'' 566@todo_wine@'@drive@@shortpath@T'@or_broken@'' 567@todo_wine@'@drive@@shortpath@ABCDEFGHIJK.LMNOP'@or_broken@'' 568@drive@@path@ 569@drive@@path@ 570@drive@ 571@drive@ 572@drive@ 573@drive@ 574'' 575'.eh'@or_broken@'' 576------------ Testing variable delayed expansion ------------ 577--- default mode (load-time expansion) 578foo 579!WINE_FOO! 580foo 581foo 582--- runtime (delayed) expansion mode 583foo 584foo@or_broken@!WINE_FOO! 585foo 586bar@or_broken@foo 5870 5880@or_broken@1 589foo 590!WINE_FOO! 591--- using /V cmd flag 592foo 593foo@or_broken@!WINE_FOO! 594foo 595!WINE_FOO! 596------------ Testing conditional execution ------------ 597--- unconditional ampersand 598foo1 599bar2@space@ 600foo2 601foobar deleted 602--- on success conditional and 603@todo_wine@foo3 not created 604bar4@space@ 605foo4 606--- on failure conditional or 607foo5 608foo6@space@ 609@todo_wine@------------ Testing cd ------------ 610singleFile 611Current dir: @drive@@path@foobar@or_broken@Current dir:@space@ 612@drive@@path@foobar 613@pwd@ 614@drive@@path@foobar 615@pwd@ 616@drive@@path@foobar 617@pwd@ 618@pwd@ 619@pwd@ 620@drive@@path@foobar\bar bak 621@drive@@path@foobar\bar bak 622@drive@@path@foobar\bar bak 623@drive@@path@foobar\bar bak 624@drive@@path@foobar\bar bak 625@pwd@ 626@drive@@path@foobar 627------------ Testing type ------------ 628 629@pwd@>type foobaz@space@ 630bar 631 632@pwd@>echo ---@space@ 633--- 634bar 635---1 636bar 637---2 638bar 639---3 640------------ Testing NUL ------------ 641bar 642bar 643bar 644NUL 645foo created 646Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 647Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 648Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 649Passed: file size check on b.b [8]@or_broken@Skipping file size check on NT4 650Passed: file size check on a.a [7]@or_broken@Skipping file size check on NT4 651Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on NT4 652------------ Testing if/else ------------ 653--- if/else should work with blocks 654if seems to work 655else seems to work 656if seems not to detect /c as parameter 657else if seems to work 658else if seems to work 659else if seems to work 660--- case sensitivity with and without /i option 661if seems to default to case sensitivity 662if /i seems to work 663if /I seems to work 664--- string comparisons 665equal 666non equal 667non equal 668equal 669--- tabs handling 670doom 671doom 672doom 673lol 674quake 675quake 676quake 677--- comparison operators 678------ for strings 679LSS string can be used as operand for LSS comparison 680floats are handled as strings 681numbers in quotes are handled as strings 682negative numbers as well@or_broken@NT4 683if /i seems to work for LSS 684A LSS B 685A LSS AB 686A LSS BA 687A LSS AA 688B LSS BA 689AB LSS B 690AB LSS BA 691AA LSS B 692AA LSS AB 693AA LSS BA 694b LSS B@or_broken@NT4 695a LSS B@or_broken@NT4 696a LSS B insensitive 697A LSS b 698A LSS b insensitive 699A LEQ A 700A LEQ B 701A LEQ AB 702A LEQ BA 703A LEQ AA 704B LEQ B 705B LEQ BA 706AB LEQ B 707AB LEQ AB 708AB LEQ BA 709BA LEQ BA 710AA LEQ B 711AA LEQ AB 712AA LEQ BA 713AA LEQ AA 714b LEQ B@or_broken@NT4 715b LEQ B insensitive 716a LEQ B@or_broken@NT4 717a LEQ B insensitive 718A LEQ b 719A LEQ b insensitive 720A EQU A 721B EQU B 722AB EQU AB 723BA EQU BA 724AA EQU AA 725A EQU a insensitive 726A NEQ B 727A NEQ AB 728A NEQ BA 729A NEQ AA 730B NEQ A 731B NEQ AB 732B NEQ BA 733B NEQ AA 734AB NEQ A 735AB NEQ B 736AB NEQ BA 737AB NEQ AA 738BA NEQ A 739BA NEQ B 740BA NEQ AB 741BA NEQ AA 742AA NEQ A 743AA NEQ B 744AA NEQ AB 745AA NEQ BA 746A GEQ A 747B GEQ A 748B GEQ B 749B GEQ AB 750B GEQ AA 751AB GEQ A 752AB GEQ AB 753AB GEQ AA 754BA GEQ A 755BA GEQ B 756BA GEQ AB 757BA GEQ BA 758BA GEQ AA 759AA GEQ A 760AA GEQ AA 761B GTR A 762B GTR AB 763B GTR AA 764AB GTR A 765AB GTR AA 766BA GTR A 767BA GTR B 768BA GTR AB 769BA GTR AA 770AA GTR A 771------ for numbers 772negative numbers handled 773negative numbers handled 774octal handled 775also in negative form 776hexa handled 777also in negative form 77811 LSS 101 7790 LSS 1 7800 LSS 10 7810 LSS 9 7821 LSS 10 7831 LSS 9 7849 LSS 10 7850 LEQ 0 7860 LEQ 1 7870 LEQ 10 7880 LEQ 9 7891 LEQ 1 7901 LEQ 10 7911 LEQ 9 79210 LEQ 10 7939 LEQ 10 7949 LEQ 9 7950 EQU 0 7961 EQU 1 79710 EQU 10 7989 EQU 9 799octal ok 800hexa ok 801string/hexa compare ok 802string/hexa compare ok 8030 NEQ 1 8040 NEQ 10 8050 NEQ 9 8061 NEQ 0 8071 NEQ 10 8081 NEQ 9 80910 NEQ 0 81010 NEQ 1 81110 NEQ 9 8129 NEQ 0 8139 NEQ 1 8149 NEQ 10 8150 GEQ 0 8161 GEQ 0 8171 GEQ 1 81810 GEQ 0 81910 GEQ 1 82010 GEQ 10 82110 GEQ 9 8229 GEQ 0 8239 GEQ 1 8249 GEQ 9 8251 GTR 0 82610 GTR 0 82710 GTR 1 82810 GTR 9 8299 GTR 0 8309 GTR 1 831------ for numbers and stringified numbers 832strings and integers not equal 833strings and integers not equal 834foo 835"10" GEQ "1" 836'1' GEQ 1@or_broken@NT4 8371 GEQ "1" 838"1" GEQ "1" 839'1' GEQ "1" 840"10" GEQ "1" 841non NT4@or_broken@1 GEQ '1' 842'1' GEQ '1' 843foo 8441 GEQ "10" 845foo 846'1' GEQ "10" 847"10" GEQ "10" 848--- unconditional ampersand after if one line 8491@space@ 8502@space@ 8513 else echo 4 852--- 853x@space@ 854--- 855x@space@ 856--- 857x@space@ 858--- 859x@space@ 860--- 861------------ Testing for ------------ 862--- plain FOR 863A 864B 865C 866%I 867%I 868%I 869%j 870%j 871%j 872A 873B 874C 8751 8764 8771 878A 879B 880C 881X 882X2 883X3 884foo 885M 886X 887M 888N 889O 890`echo 891A 892B` 893'echo 894A 895B' 896"echo A B" 897"A B" 898C 899--- imbricated FORs 900X Y 901X Y 902A C 903A D 904B C 905B D 906A C 907A D 908B C 909B D 910--- basic wildcards 911bazbaz 912--- for /d 913baz@space@ 914foo@space@ 915bar@space@ 916PASSED 917xxx - Should be xxx 918Expected second line 919--- for /R 920Plain directory enumeration 921Plain directory enumeration from provided root 922File enumeration 923File enumeration from provided root 924Mixed enumeration 925Mixed enumeration from provided root 926With duplicates enumeration 927Strip missing wildcards, keep unwildcarded names 928for /R passed 929--- Complex wildcards unix and windows slash 930Windows slashes, valid path 931ASIS: foobar\baz\bazbaz 932WC : foobar\baz\bazbaz 933Windows slashes, invalid path 934ASIS: foobar\jim\bazbaz 935Unix slashes, valid path 936ASIS: foobar/baz/bazbaz 937WC : bazbaz 938Unix slashes, invalid path 939ASIS: foobar/jim/bazbaz 940Done 941--- for /L 9421 9433 9445 9451 9463 9475 9480 9492 9501 951-1 952ErrorLevel 0 953ErrorLevel 0 9541 9552 9563 9574 9581 9593 9604 9613 9622 9631 9644 9652 9660 9671 9681 969-1 970-1 9711 9723 973--- set /a 974------ individual operations 975WINE_foo correctly 3 976WINE_foo correctly -1 977WINE_foo correctly 3 978WINE_foo correctly 6 979WINE_foo correctly 10 980WINE_foo correctly 4 981WINE_foo correctly 4 982WINE_foo correctly -4 983WINE_foo correctly 0 984WINE_foo correctly 2 985WINE_foo correctly 2 986WINE_foo correctly -2 987WINE_foo correctly 1 988WINE_foo correctly 4 989WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1073741824 [0] 990WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1073741824 [0] 991WINE_foo correctly -4 992WINE_foo correctly 9 993WINE_foo correctly 2 994WINE_foo correctly 0 995WINE_foo correctly -1 996WINE_foo correctly -3 997WINE_foo correctly 0 998WINE_foo correctly 1 999WINE_foo correctly 1 1000WINE_foo correctly 4 1001WINE_foo correctly 1 1002WINE_foo correctly 5 1003WINE_foo correctly 5 1004WINE_foo correctly 7 1005WINE_foo correctly 5 1006WINE_foo correctly 5 1007WINE_foo correctly 5 1008WINE_foo correctly 4 1009WINE_foo correctly 6 1010WINE_foo correctly 1 1011WINE_foo correctly 4 1012------ precedence and grouping 1013WINE_foo correctly 10 1014WINE_foo correctly 18@or_broken@ERROR: WINE_foo incorrectly [18] 1015WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly 0 [2] 1016WINE_foo correctly 2@or_broken@ERROR: WINE_foo incorrectly [2] 1017WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 4 [0] 1018WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly [4] 1019WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1020WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly [3] 1021------ octal and hexadecimal 1022WINE_foo correctly 18 1023WINE_foo correctly 18 1024WINE_foo correctly 15 1025WINE_foo correctly 3 1026------ variables 1027WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1028WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1029WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1030WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly [4] 1031WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly 0 [3] 1032WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1033WINE_baz correctly 4@or_broken@ERROR: WINE_baz incorrectly [4] 1034WINE_foo correctly 9@or_broken@ERROR: WINE_foo incorrectly 3 [9] 1035WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly 3 [9] 1036WINE_foo correctly 0 1037WINE_foo correctly 4 1038WINE_bar correctly 4 1039WINE_foo correctly -7@or_broken@ERROR: WINE_foo incorrectly 4 [-7] 1040WINE_bar correctly -7@or_broken@ERROR: WINE_bar incorrectly 4 [-7] 1041WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly -7 [-1] 1042WINE_bar correctly -1@or_broken@ERROR: WINE_bar incorrectly -7 [-1] 1043WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1044WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly [1] 1045WINE_foo correctly 4@or_broken@ERROR: WINE_foo incorrectly 1 [4] 1046WINE_bar correctly 4@or_broken@ERROR: WINE_bar incorrectly 1 [4] 1047WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 4 [1] 1048WINE_bar correctly 1@or_broken@ERROR: WINE_bar incorrectly 4 [1] 1049WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly 1 [0] 1050WINE_bar correctly 0@or_broken@ERROR: WINE_bar incorrectly 1 [0] 1051WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1052WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1053WINE_foo correctly 5@or_broken@ERROR: WINE_foo incorrectly 0 [5] 1054WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly [7] 1055WINE_foo correctly 19@or_broken@ERROR: WINE_foo incorrectly 0 [19] 1056WINE_bar correctly 3@or_broken@ERROR: WINE_bar incorrectly [3] 1057WINE_baz correctly 4 1058--- quotes 1059WINE_foo correctly 1 1060WINE_foo correctly 1 1061WINE_foo correctly 1 1062WINE_bar correctly 2 1063WINE_foo correctly 1 1064WINE_bar correctly 2 1065WINE_foo correctly 1 1066WINE_bar correctly 2 1067WINE_foo correctly 1 1068WINE_bar correctly 2 1069WINE_foo correctly 1 1070WINE_bar correctly 2 1071WINE_baz correctly 3 1072WINE_foo correctly 1 1073WINE_bar correctly 2 1074WINE_baz correctly 3 1075WINE_foo correctly 1 1076WINE_bar correctly 2 1077WINE_baz correctly 3 1078WINE_foo correctly 1 1079WINE_bar correctly 2 1080WINE_baz correctly 3 1081WINE_foo correctly 1 1082WINE_bar correctly 2 1083WINE_baz correctly 3 1084WINE_foo correctly 1 1085WINE_foo correctly 1 1086WINE_bar correctly 5 1087WINE_baz correctly 2 1088WINE_foo correctly 18 1089WINE_foo correctly 3 1090WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 4 [7] 1091--- whitespace are ignored between double char operators 1092WINE_foo correctly 10@or_broken@ERROR: WINE_foo incorrectly 4 [10] 1093WINE_bar correctly 50@or_broken@ERROR: WINE_bar incorrectly 5 [50] 1094WINE_foo correctly 772@or_broken@ERROR: WINE_foo incorrectly 4 [772] 1095WINE_bar correctly 7720@or_broken@ERROR: WINE_bar incorrectly 5 [7720] 1096--- invalid operator sequence 10974 10984 1099----- negative prefix 1100WINE_foo correctly -1 1101WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1102WINE_foo correctly 6 1103WINE_foo correctly 0 1104WINE_foo correctly 6 1105WINE_foo correctly 2 1106WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1107WINE_foo correctly 5 1108WINE_foo correctly 3@or_broken@ERROR: WINE_foo incorrectly -5 [3] 1109----- assignment tests involving the end destination 1110WINE_foo correctly 11@or_broken@ERROR: WINE_foo incorrectly 3 [11] 1111WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1112WINE_bar correctly 9@or_broken@ERROR: WINE_bar incorrectly [9] 1113WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 2 [6] 1114WINE_bar correctly 10@or_broken@ERROR: WINE_bar incorrectly [10] 1115WINE_baz correctly 7@or_broken@ERROR: WINE_baz incorrectly [7] 1116WINE_foo correctly 7@or_broken@ERROR: WINE_foo incorrectly 2 [7] 1117WINE_bar correctly 7@or_broken@ERROR: WINE_bar incorrectly 2 [7] 1118----- equal precedence on stack 1119WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1120WINE_foo correctly 0 1121WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1122WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1123WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1124WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1125WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly [-1] 1126WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly [1] 1127WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly [0] 1128WINE_foo correctly -1 1129WINE_foo correctly 0@or_broken@ERROR: WINE_foo incorrectly -1 [0] 1130WINE_foo correctly 0 1131WINE_foo correctly 1@or_broken@ERROR: WINE_foo incorrectly 0 [1] 1132WINE_foo correctly -1@or_broken@ERROR: WINE_foo incorrectly 0 [-1] 1133WINE_foo correctly 25@or_broken@ERROR: WINE_foo incorrectly 20 [25] 1134WINE_foo correctly 20 1135WINE_foo correctly 1 1136WINE_foo correctly 4 1137WINE_foo correctly 7 1138WINE_foo correctly 8@or_broken@ERROR: WINE_foo incorrectly 4 [8] 1139WINE_foo correctly 6@or_broken@ERROR: WINE_foo incorrectly 5 [6] 1140WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6] 1141--- for /F 1142------ string argument 1143a 1144a@or_broken@no output 1145a 1146a@or_broken@no output 1147a 1148a@or_broken@no output 1149a 1150a@or_broken@no output 1151a 1152a@or_broken@no output 1153------ fileset argument 1154--------- basic blank handling 1155a 1156a 1157a 1158a 1159a 1160b 1161--------- multi-line with empty lines 1162a 1163b 1164c 1165--------- multiple files 1166a 1167b 1168c 1169q 1170kkk 1171q 1172kkk 1173a 1174b 1175c 1176------ command argument 1177Passed1@or_broken@Missing functionality - Broken1 1178Passed2@or_broken@Missing functionality - Broken2 1179Passed3@or_broken@Missing functionality - Broken3 1180------ eol option 1181and@or_broken@Broken NT4 functionality1 1182Line@or_broken@Broken NT4 functionality2 1183Line@or_broken@Broken NT4 functionality3 1184ad 1185z@y 1186a|d 1187no output 1188no output 1189------ delims option 1190a 1191a@space@ 1192a d 1193a 1194C r 1195foo bar baz 1196c:\ 1197------ skip option 1198c 1199no output 1200no output 1201c 1202c 1203no output 1204------ tokens= option 1205h=%h i=a j=%j k=%k l=%l m=%m o=%o 1206h=%h i=b j=%j k=%k l=%l m=%m o=%o 1207h=%h i=a j=c k=e l=f m=g o=%o 1208h=%h i=a j=e k=f g l=%l m=%m o=%o 1209h=%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 1210h=%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 1211h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1212h=%h i=a j=b k=c l=d e f g m=%m n=%n o=%o 1213h=%h i=a j=b k= l= m=%m n=%n o=%o 1214h=%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 1215h=%h i=a j=b k= l= m= n=%n o=%o 1216h=%h i=a j=b k= l= m= n= o=%o 1217u=a v=b w=c x=d y=e z=f A=%A a=%a 1218@todo_wine@U=a V=b W=c X=d Y=e Z=f A=%A a=m 1219h=%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 1220h=%h i=e j=%j k=%k l=%l m=%m o=%o 1221h=%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 1222h=%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 1223h=%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 1224h=%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 1225------ parameter splitting 1226:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 1227:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@ 1228------------ Testing del ------------ 1229deleting 'file' 1230errorlevel is 0, good 1231successfully deleted 'file' 1232attempting to delete 'file', even though it is not present 1233errorlevel is 0, good 1234------------ Testing del /a ------------ 1235not-r.test not found after delete, good 1236r.test found before delete, good 1237r.test not found after delete, good 1238------------ Testing del /q ------------ 1239del /q * succeeded on file1 1240del /q * succeeded on file2.dat 1241------------ Testing del /s ------------ 1242------------ Testing rename ------------ 1243--- ren and rename are synonymous 1244foo renamed to bar 1245bar renamed to foo 1246--- name collision 1247foo 1248bar 1249--- rename read-only files 1250read-only file renamed 1251--- rename directories 1252dir renamed 1253read-only dir renamed 1254--- rename in other directory 1255rename impossible in other directory 1256original file still present 1257------------ Testing move ------------ 1258--- file move 1259file move succeeded 1260@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible! 1261@todo_wine@bar@or_broken@baz 1262read-only files are moveable 1263file moved in subdirectory 1264moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op! 1265ErrorLevel: 0@or_broken@ErrorLevel: 1 1266--- directory move 1267simple directory move succeeded 1268moving a directory to itself gives error; errlevel 1 1269------ dir in dir move 1270foo 1271bar2 1272foo2 1273------------ Testing mkdir ------------ 1274--- md and mkdir are synonymous 12750 12760 1277--- creating an already existing directory/file must fail 12781 12791 1280--- multilevel path creation 12810 12820 12830 12840 12850 12861 12870 12880 1289--- trailing backslashes 12900 1291dir created 12920 1293--- invalid chars 1294mkdir ? gives errorlevel 1 1295mkdir ?\foo gives errorlevel 1 1296mkdir foo\? gives errorlevel 1 1297ok, foo created 1298mkdir foo\bar\? gives errorlevel 1 1299ok, foo\bar created 1300--- multiple directories at once 1301foo created 1302bar created 1303foobar created 1304bar\baz created 1305bazbaz created 1306zabzab created 1307mkdir foo\* errorlevel 1 1308ok, foo created 1309------------ Testing rmdir ------------ 13100 1311dir removed 13120 1313dir removed 13140 13150 1316file not removed 13170 1318non-empty dir not removed 13190 1320non-empty dir not removed 1321recursive rmdir succeeded 1322recursive rmdir succeeded 1323foo removed 1324bar removed 1325foobar removed 1326bar\baz removed 1327------------ Testing pushd/popd ------------ 1328@pwd@ 1329--- popd is no-op when dir stack is empty 1330@pwd@ 1331--- pushing non-existing dir 1332@pwd@ 1333--- basic behaviour 1334@drive@@path@foobar 1335@pwd@ 1336@drive@@path@foobar\baz 1337@drive@@path@foobar 1338@drive@@path@foobar 1339@pwd@ 1340@drive@@path@foobar 1341@pwd@ 1342------------ Testing attrib ------------ 1343A @drive@@path@foobar\foo@or_broken@A @drive@@path@foobar\foo@or_broken@A I @drive@@path@foobar\foo 1344--- read-only attribute 1345A R @drive@@path@foobar\foo@or_broken@A R @drive@@path@foobar\foo@or_broken@A R I @drive@@path@foobar\foo 1346foo 1347foo original contents 1348Read-only file not deleted 1349Read-only file forcibly deleted 1350--- recursive behaviour 1351A @drive@@path@foobar\baz\level2@or_broken@A @drive@@path@foobar\baz\level2@or_broken@A I @drive@@path@foobar\baz\level2 1352A R @drive@@path@foobar\level1@or_broken@A R @drive@@path@foobar\level1@or_broken@A R I @drive@@path@foobar\level1 1353A R @drive@@path@foobar\baz\level2@or_broken@A R @drive@@path@foobar\baz\level2@or_broken@A R I @drive@@path@foobar\baz\level2 1354A @drive@@path@foobar\bar@or_broken@A @drive@@path@foobar\bar@or_broken@A I @drive@@path@foobar\bar 1355--- folders processing 1356 @drive@@path@foobar@or_broken@ @drive@@path@foobar@or_broken@ I @drive@@path@foobar 1357@todo_wine@ R @drive@@path@foobar\baz@or_broken@ R @drive@@path@foobar\baz@or_broken@ @drive@@path@foobar\baz@or_broken@ R I @drive@@path@foobar\baz 1358A @drive@@path@foobar\baz\toto@or_broken@A @drive@@path@foobar\baz\toto@or_broken@A I @drive@@path@foobar\baz\toto 1359toto 1360lulu 1361file created in read-only dir 1362------------ Testing assoc ------------ 1363--- setting association 1364--- 1365.foo=bar 1366.foo=bar 1367+++ 1368.foo=bar 1369--- resetting association 1370--- 1371+++ 1372--- 1373------------ Testing ftype ------------ 1374--- setting association 1375--- 1376footype=foo_opencmd 1377.foo=footype 1378footype=foo_opencmd 1379+++ 1380footype=foo_opencmd 1381--- resetting association 1382@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO! 1383------------ Testing CALL ------------ 1384--- external script 1385foo@space@ 1386foo 8 1387foo@space@@space@ 1388foo bar@space@ 1389foo ""@space@ 1390"" bar@space@ 1391foo ''@space@ 1392'' bar@space@ 1393--- internal routines 1394bar :testRoutine 1395foo@space@ 1396foo bar 1397foo "" 1398"" bar 1399foo '' 1400'' bar 1401--- with builtins 14020 1403foo created 1404Should expand foobaz 1405batfile 1406robinfile 14071 14081 1409non-builtin dir 1410Line one 1411Line two 1412Get if 1413... and else! 1414passed 1415------------ Testing SHIFT ------------ 1416'p1' 'p2' 'p3' 'p4' 'p5' 1417'p2' 'p3' 'p4' 'p5' '' 1418'p3' 'p4' 'p5' '' '' 1419'p3' 'p5' '' '' '' 1420'p3' 'p5' '' '' '' 1421'p5' '' '' '' '' 1422------------ Testing cmd invocation ------------ 1423--- a batch file can delete itself 1424file correctly deleted 1425--- a batch file can alter itself 1426bar 1427---------- Testing copy 1428Passed: Found expected dummy.file 1429Passed: Found expected dir1\file1 1430Passed: Found expected dir1\file1 1431Passed: Found expected dir1\file99 1432Passed: Found expected file1 1433Passed: Did not find dir2 1434Passed: Did not find dir2\file1 1435Passed: Found expected dir1\file1 1436Passed: Found expected dir1\file2 1437Passed: Found expected dir1\file3 1438Passed: Found expected dir1\file1 1439Passed: Found expected dir1\file2 1440Passed: Found expected dir1\file3 1441Passed: Found expected file1 1442Passed: Found expected file2 1443Passed: Found expected file3 1444Passed: Did not find dir2 1445Passed: Did not find dir2\file1 1446Passed: Did not find dir2\file2 1447Passed: Did not find dir2\file3 1448Passed: Found expected testfile 1449Passed: Found expected testfile 1450Passed: Found expected testfile 1451Passed: Found expected testfile 1452Passed: Found expected testfile 1453Passed: Found expected dir1\fred 1454Passed: Found expected dir1\fred 1455Passed: Found expected fred 1456Passed: Found expected fred 1457Passed: file size check on file1 [5]@or_broken@Skipping file size check on NT4 1458Passed: file size check on file2 [8]@or_broken@Skipping file size check on NT4 1459Passed: file size check on file3 [11]@or_broken@Skipping file size check on NT4 1460Passed: file size check on file1_default [5]@or_broken@Skipping file size check on NT4 1461Passed: file size check on file1_default2 [5]@or_broken@Skipping file size check on NT4 1462Passed: file size check on file1_plus_eof [6]@or_broken@Skipping file size check on NT4 1463Passed: file size check on file2_plus_eof [9]@or_broken@Skipping file size check on NT4 1464Passed: file size check on file3_plus_eof [12]@or_broken@Skipping file size check on NT4 1465Passed: file size check on file12_plus_eof [14]@or_broken@Skipping file size check on NT4 1466Passed: file size check on file12_no_eof [13]@or_broken@Skipping file size check on NT4 1467Passed: file size check on file12_eof2 [14]@or_broken@Skipping file size check on NT4 1468Passed: file size check on file1 [24]@or_broken@Skipping file size check on NT4 1469Passed: file size check on file2 [16]@or_broken@Skipping file size check on NT4 1470Passed: file size check on file3 [13]@or_broken@Skipping file size check on NT4 1471Passed: file size check on file1_binary_srccopy [6]@or_broken@Skipping file size check on NT4 1472Passed: file size check on file1_ascii_srccopy [5]@or_broken@Skipping file size check on NT4 1473Passed: file size check on file123_default_copy [25]@or_broken@Skipping file size check on NT4 1474Passed: file size check on file123_ascii_copy [25]@or_broken@Skipping file size check on NT4 1475Passed: file size check on file123_binary_copy [27]@or_broken@Skipping file size check on NT4 1476Passed: file size check on file123_mixed_copy1 [26]@or_broken@Skipping file size check on NT4 1477Passed: file size check on file123_mixed_copy2 [27]@or_broken@Skipping file size check on NT4 1478Passed: file size check on file123_mixed_copy3 [26]@or_broken@Skipping file size check on NT4 1479Passed: file size check on file123_mixed_copy4 [25]@or_broken@Skipping file size check on NT4 1480Passed: file size check on file123_mixed_copy5 [28]@or_broken@Skipping file size check on NT4 1481Passed: file size check on file123_mixed_copy6 [19]@or_broken@Skipping file size check on NT4 1482Passed: file size check on file123_mixed_copy7 [6]@or_broken@Skipping file size check on NT4 1483Passed: file size check on file123_mixed_copy8 [7]@or_broken@Skipping file size check on NT4 1484Passed: errorlevel invalid check 1 1485Passed: Did not find dir1\file1 1486Passed: errorlevel invalid check 2 1487Passed: errorlevel invalid check 3 1488------------ Testing setlocal/endlocal ------------ 1489--- enable/disable extensions 1490@todo_wine@ErrLev:@space@ 1491ErrLev: 0 1492ErrLev: 0 1493@todo_wine@ErrLev:@space@@or_broken@ErrLev: 0 1494ErrLev: 0 1495--- setlocal with corresponding endlocal 1496globalval 1497localval 1498@drive@@path@foobar\foobar2 1499globalval 1500@drive@@path@foobar 1501globalval 1502@drive@@path@foobar 1503--- setlocal with no corresponding endlocal 1504globalval 1505localval 1506@drive@@path@foobar\foobar2 1507globalval 1508@drive@@path@foobar 1509--- setlocal within same batch program 1510Var1 ok 1 1511Var2 ok 2 1512Var3 ok 3 1513Directory is ok 1 1514Var1 ok 1 1515Var2 ok 2 1516Var3 ok 3 1517Directory is ok 2 1518Var1 ok 1 1519Var2 ok 2 1520Var3 ok 3 1521Directory is ok 3 1522--- Mismatched set and end locals 1523--- Extra setlocal in called batch 1524value2 15252set1endvalue1 1526@drive@@path@foobar\foodir3 1527Finished: 1528value2 1529@drive@@path@foobar\foodir2 1530value1 1531@drive@@path@foobar 1532--- Extra endlocal in called batch 1533value2 1534value2 1535@drive@@path@foobar\foodir2 1536value2 1537@drive@@path@foobar\foodir2 1538Finished: 1539value2 1540@drive@@path@foobar\foodir2 1541value1 1542@drive@@path@foobar 1543--- endlocal in called function rather than batch pgm is ineffective 15442 15452 15461 15472 15481 15492 15501 15511 1552------------ Testing Errorlevel ------------ 15539009 15541 1555errorlevel just right, good 1556errorlevel with leading zero just right, good 1557errorlevel with negative number OK 1558abc0def@or_broken@abc1def 1559errorlevel zero, good@or_broken@errorlevel nonzero, bad 15607 should be 7 15617 should still be 7 1562------------ Testing GOTO ------------ 1563goto with no leading space worked 1564goto with colon and no leading space worked 1565goto with a leading space worked 1566goto with a leading tab worked 1567goto with a following space worked 1568goto with following amphersands worked 1569goto with redirections worked 1570Ignoring double colons worked 1571label with mixed whitespace and no echo worked 1572Correctly ignored trailing information 1573------------ Testing PATH ------------ 1574PATH=original 1575PATH=try2 1576PATH=try3 1577------------ Testing combined CALLs/GOTOs ------------ 1578world 1579cheball 1580barbare 1581bar 1582foo 1583baz 1584cheball 1585barbare 1586