Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
killer_sokoban
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Schulcz Ferenc
killer_sokoban
Commits
5858b026
Commit
5858b026
authored
Apr 6, 2018
by
sfphoton
Browse files
Options
Downloads
Patches
Plain Diff
Tester script for proto added
parent
47c02c8f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tester.ps1
+41
-0
41 additions, 0 deletions
tester.ps1
with
41 additions
and
0 deletions
tester.ps1
0 → 100644
+
41
−
0
View file @
5858b026
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!"
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment