File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ @ ECHO OFF
2+ FOR /L %%i IN (0, 1, 10) DO CALL :FOO %%i
3+ GOTO :END
4+
5+ :FOO
6+ SETLOCAL ENABLEDELAYEDEXPANSION
7+ SET /A t = (43200 * %1 + 21600) / 11
8+ SET /A h = %t% / 3600
9+ SET /A m = %t% / 60 %% 60
10+ SET /A s = %t% %% 60
11+ IF %h% EQU 0 SET h = 12
12+ SET h = 0%h%
13+ SET m = 0%m%
14+ SET s = 0%s%
15+ SET h = !h:~-2 !
16+ SET m = !m:~-2 !
17+ SET s = !s:~-2 !
18+ ECHO %h% :%m% :%s%
19+ ENDLOCAL
20+ :END
Original file line number Diff line number Diff line change 1+ function Assert-MatchTests {
2+ param (
3+ [Parameter (Mandatory = $true , ValueFromPipeline )] $TestResult
4+ )
5+
6+ if ($TestResult ) {
7+ Write-Error " Output does not match expected results."
8+ }
9+ }
10+
11+ $Error.clear ()
12+ . " $PSScriptRoot \clockhands.bat" |
13+ Compare-Object (Get-Content " $PSScriptRoot \..\test\clockhands_expected" ) |
14+ Assert-MatchTests &&
15+ . " $PSScriptRoot \hello.bat" &&
16+ ForEach-Object ' foo'
17+
18+ if ($Error -or ! $? ) {
19+ " *** BATCH TESTS FAILED ***"
20+ }
21+ else {
22+ " BATCH TESTS PASSED"
23+ }
You can’t perform that action at this time.
0 commit comments