Skip to content
Snippets Groups Projects
Verified Commit 9f4a6cc1 authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

stderr

parent bb658a9f
No related branches found
No related tags found
No related merge requests found
Pipeline #7543 passed
...@@ -45,6 +45,7 @@ public class Main { ...@@ -45,6 +45,7 @@ public class Main {
var in = proc.getOutputStream(); var in = proc.getOutputStream();
var out = proc.getInputStream(); var out = proc.getInputStream();
var err = proc.getErrorStream();
try { try {
in.write(test.input.getBytes(StandardCharsets.UTF_8)); in.write(test.input.getBytes(StandardCharsets.UTF_8));
...@@ -65,10 +66,15 @@ public class Main { ...@@ -65,10 +66,15 @@ public class Main {
} }
String o = ""; String o = "";
String er = "";
try { try {
byte[] by = out.readAllBytes(); byte[] by = out.readAllBytes();
o = new String(by, StandardCharsets.UTF_8); o = new String(by, StandardCharsets.UTF_8);
o = yeetEmpty(o); o = yeetEmpty(o);
by = err.readAllBytes();
er = new String(by, StandardCharsets.UTF_8);
er = yeetEmpty(er);
} catch (Exception e){ } catch (Exception e){
System.out.print("❌ "); System.out.print("❌ ");
System.out.println("Nem sikerült kiolvasni a program outputját."); System.out.println("Nem sikerült kiolvasni a program outputját.");
...@@ -92,8 +98,8 @@ public class Main { ...@@ -92,8 +98,8 @@ public class Main {
System.out.println(); System.out.println();
try { try {
String got = fileToString(f); String got = fileToString(f);
boolean er = compareStrings(got, e); boolean erro = compareStrings(got, e);
if (er) { if (erro) {
error.set(true); error.set(true);
} else { } else {
System.out.print("✔️ "); System.out.print("✔️ ");
...@@ -110,6 +116,14 @@ public class Main { ...@@ -110,6 +116,14 @@ public class Main {
System.out.println("--------------"); System.out.println("--------------");
if (!er.trim().isEmpty()) {
error.set(true);
System.out.println("❌ Standard error kimenet:");
System.out.println(er);
System.out.println("--------------");
}
if (error.get()) { if (error.get()) {
System.out.print("\uD83D\uDD25 "); System.out.print("\uD83D\uDD25 ");
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment