aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/testing/ExecutionResult.java
blob: f4a37385771ac4e2ba06f38bcb46dbfce1386111 (plain)
1
2
3
4
5
6
7
8
9
10
11
package org.shedlang.compiler.testing;

public record ExecutionResult(int exitCode, String stdout, String stderr) {
    public ExecutionResult throwOnError() {
        if (exitCode == 0) {
            return this;
        } else {
            throw new AssertionError("exit code was " + exitCode + "\nstdout:\n" + stdout + "\nstderr:\n" + stderr);
        }
    }
}