Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tester
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
insert epic projlab name here
tester
Commits
7238d70d
Verified
Commit
7238d70d
authored
4 years ago
by
Tóth Miklós Tibor
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
2e1dceea
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#7509
passed
4 years ago
Stage: build
Changes
1
Pipelines
17
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/tester/Main.java
+17
-0
17 additions, 0 deletions
src/main/java/tester/Main.java
with
17 additions
and
0 deletions
src/main/java/tester/Main.java
+
17
−
0
View file @
7238d70d
...
...
@@ -11,6 +11,19 @@ import java.util.concurrent.atomic.AtomicBoolean;
import
java.util.stream.Stream
;
public
class
Main
{
private
static
String
yeetEmpty
(
String
input
)
{
var
sb
=
new
StringBuilder
();
for
(
var
line:
input
.
split
(
"\n"
))
{
var
trimmed
=
line
.
trim
();
if
(
trimmed
.
length
()
>
0
)
{
sb
.
append
(
trimmed
);
sb
.
append
(
"\n"
);
}
}
return
sb
.
toString
();
}
public
static
void
main
(
String
[]
args
)
throws
FileNotFoundException
{
if
(
args
.
length
<
2
)
{
System
.
out
.
println
(
"usage: <tested_app.jar> <testcase.json>"
);
...
...
@@ -21,6 +34,9 @@ public class Main {
TestCase
test
=
gson
.
fromJson
(
new
FileReader
(
args
[
1
]),
TestCase
.
class
);
test
.
input
=
yeetEmpty
(
test
.
input
);
test
.
output
=
yeetEmpty
(
test
.
output
);
if
(
System
.
getProperty
(
"os.name"
).
toLowerCase
().
contains
(
"win"
)){
try
{
ProcessBuilder
pb
=
new
ProcessBuilder
(
"cmd.exe"
,
"/c"
,
"@chcp"
,
"65001>nul"
).
inheritIO
();
...
...
@@ -69,6 +85,7 @@ public class Main {
try
{
byte
[]
by
=
out
.
readAllBytes
();
o
=
new
String
(
by
,
StandardCharsets
.
UTF_8
);
o
=
yeetEmpty
(
o
);
}
catch
(
Exception
e
){
System
.
out
.
print
(
"❌ "
);
System
.
out
.
println
(
"Nem sikerült kiolvasni a program outputját."
);
...
...
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