Skip to content

Commit 4625744

Browse files
committed
Added PowerShell test for AsciiDots
1 parent f7105bd commit 4625744

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

asciidots/test.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
asciidots "$PSScriptRoot\clockhands.dots" |
13+
Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") |
14+
Assert-MatchTests &&
15+
asciidots "$PSScriptRoot\hello.dots" &&
16+
ForEach-Object 'foo'
17+
18+
if ($Error -or !$?) {
19+
"*** ASCIIDOTS TESTS FAILED ***"
20+
}
21+
else {
22+
"ASCIIDOTS TESTS PASSED"
23+
}

0 commit comments

Comments
 (0)