2 :: PROJECT: ReactOS CMD Testing Suite
3 :: LICENSE: GPL v2 or any later version
4 :: FILE: tests/redirect.cmd
5 :: PURPOSE: Tests for redirections
6 :: COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
9 :: One redirect, the file must exist
10 call :_test "echo moo > temp\redirect_temp.txt"
11 call :_test "type temp\redirect_temp.txt >nul"
12 call :_test "find "moo" temp\redirect_temp.txt >nul"
14 :: Add the string yet another time to the file
15 call :_test "echo moo >> temp\redirect_temp.txt"
19 :: Count the moo's in the file (must be 2 now)
20 :: No idea why so many percent signs are necessary here :-)
21 call :_test "for /f "usebackq" %%%%i in (`findstr moo temp\redirect_temp.txt`) do set /a moo_temp+=1"
22 call :_testvar %moo_temp% moo_temp 2
24 :: Two redirects, the file in the middle mustn't exist after this call
25 call :_test "echo moo > temp\redirect_temp2.txt > nul"
26 call :_testnot "type temp\redirect_temp2.txt 2>nul"