Skip to content

Commit 0104afb

Browse files
committed
feat: Add asserts to the board-info check
1 parent b9e365b commit 0104afb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

espflash/tests/cli.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ use std::thread::sleep;
44
use std::time::Duration;
55

66
#[test]
7-
fn flash() -> Result<(), Box<dyn std::error::Error>> {
7+
fn cli_tests() -> Result<(), Box<dyn std::error::Error>> {
88
// board-info
99
let mut cmd: Command = Command::cargo_bin("espflash")?;
10-
1110
cmd.arg("board-info");
12-
cmd.assert().success();
11+
12+
let binding = cmd.assert().success();
13+
let output = binding.get_output();
14+
15+
let output_stdout = String::from_utf8_lossy(&output.stdout).to_string();
16+
17+
assert!(output_stdout.contains("esp32"));
18+
assert!(output_stdout.contains("revision"));
1319

1420
// flash
1521
let image = std::env::var("ESPFLASH_APP").expect("ESPFLASH_APP not set");
@@ -41,5 +47,6 @@ fn flash() -> Result<(), Box<dyn std::error::Error>> {
4147
let output = child.wait_with_output().expect("Failed to read stdout");
4248
let output = String::from_utf8_lossy(&output.stdout).to_string();
4349
assert!(output.contains("Hello world!"));
50+
4451
Ok(())
4552
}

0 commit comments

Comments
 (0)