Skip to content
Snippets Groups Projects
Commit 5858b026 authored by sfphoton's avatar sfphoton
Browse files

Tester script for proto added

parent 47c02c8f
Branches
No related tags found
No related merge requests found
function test([string]$testfile, [string]$expectedfile) {
$expResult = cat $expectedfile
$input = cat $testfile
$output = echo $input | java -cp .\class\ killer_sokoban.Main
$diff = compare $output $expResult
if ($diff.Length -eq 0) {
echo "Test with test file $testfile passed."
} else {
echo "Test with test file $testfile FAILED!"
echo "Got:"
echo "-------------------------------------"
echo $output
echo "Expected:"
echo "-------------------------------------"
echo $expResult
}
}
function testAll() {
$tfiles = dir -fi "*.in" -Name
foreach ($item in $tfiles) {
$temp = $item.Substring(0, $item.LastIndexOf('.'))
test $item "$temp.out"
}
}
#main
if ($args.Count -eq 0) {
testAll
} elseif($args.Count -eq 2) {
test $args[0] $args[1]
} else {
echo "Wrong number of arguments!"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment