Skip to content

Commit 0838a3f

Browse files
committed
test: Inspect actual and expected
1 parent b15866e commit 0838a3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/json.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn json_input() {
101101
unit_and_tree: sample_tree().into_reflection().into(),
102102
};
103103
let json = serde_json::to_string_pretty(&json_data).expect("convert sample tree to JSON");
104-
eprintln!("JSON: {}", json);
104+
eprintln!("JSON: {}\n", json);
105105
let workspace = Temp::new_dir().expect("create temporary directory");
106106
let mut child = Command::new(PDU)
107107
.with_current_dir(workspace.as_path())
@@ -125,6 +125,7 @@ fn json_input() {
125125
.expect("wait for output of child process")
126126
.pipe(stdout_text);
127127
let actual = actual.trim();
128+
eprintln!("ACTUAL:\n{}\n", &actual);
128129

129130
let visualizer = Visualizer {
130131
data_tree: &sample_tree(),
@@ -135,6 +136,7 @@ fn json_input() {
135136
};
136137
let expected = format!("{}", visualizer);
137138
let expected = expected.trim();
139+
eprintln!("EXPECTED:\n{}\n", expected);
138140

139141
assert_eq!(actual, expected);
140142
}
@@ -170,6 +172,7 @@ fn json_output_json_input() {
170172
.output()
171173
.expect("spawn command with --json-input")
172174
.pipe(stdout_text);
175+
eprintln!("ACTUAL:\n{}\n", &actual);
173176

174177
let expected = Command::new(PDU)
175178
.with_current_dir(workspace.as_path())
@@ -183,6 +186,7 @@ fn json_output_json_input() {
183186
.output()
184187
.expect("spawn command for expected")
185188
.pipe(stdout_text);
189+
eprintln!("EXPECTED:\n{}\n", expected);
186190

187191
assert_eq!(actual, expected);
188192
}

0 commit comments

Comments
 (0)