argsProcessed = TRUE;
found = WCMD_delete_one(thisArg);
- if (!found) {
- errorlevel = 1;
+ if (!found)
WCMD_output_stderr(WCMD_LoadMessage(WCMD_FILENOTFOUND), thisArg);
- }
foundAny |= found;
}
cd ..
rd /s/q foobar
+echo ------------ Testing del ------------
+echo abc > file
+echo deleting 'file'
+del file
+if errorlevel 0 (
+ echo errorlevel is 0, good
+) else (
+ echo unexpected errorlevel, got %errorlevel%
+)
+if not exist file (
+ echo successfully deleted 'file'
+) else (
+ echo error deleting 'file'
+)
+echo attempting to delete 'file', even though it is not present
+del file
+if errorlevel 0 (
+ echo errorlevel is 0, good
+) else (
+ echo unexpected errorlevel, got %errorlevel%
+)
+
echo ------------ Testing del /a ------------
del /f/q *.test > nul
echo r > r.test
h=%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
h=%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
h=%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
+------------ Testing del ------------
+deleting 'file'
+errorlevel is 0, good
+successfully deleted 'file'
+attempting to delete 'file', even though it is not present
+errorlevel is 0, good
------------ Testing del /a ------------
not-r.test not found after delete, good
r.test found before delete, good