File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed 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+ $bin = " $PSScriptRoot \bin"
12+
13+ # First check if folder bin exists. If not, make a new bin folder.
14+ if (! (Test-Path - Path $bin )) {
15+ New-Item - Path $bin - Type Directory
16+ }
17+
18+ $Error.clear ()
19+ nim c " $PSScriptRoot \permutations.nim" && . " $PSScriptRoot \permutations.exe" I like carrots |
20+ Compare-Object (Get-Content " $PSScriptRoot \..\test\carrots_expected" ) |
21+ Assert-MatchTests &&
22+ nim c " $PSScriptRoot \triple.nim" && . " $PSScriptRoot \triple.exe" |
23+ Compare-Object (Get-Content " $PSScriptRoot \..\test\triple_expected" ) |
24+ Assert-MatchTests &&
25+ ForEach-Object ' foo'
26+
27+ if ($Error -or ! $? ) {
28+ " *** NIM TESTS FAILED ***"
29+ }
30+ else {
31+ " NIM TESTS PASSED"
32+ }
You can’t perform that action at this time.
0 commit comments