diff options
| author | mo8it <mo8it@proton.me> | 2024-04-05 00:44:43 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-05 00:44:43 +0200 |
| commit | 5a233398ebe7078767404bd05ca06e08b37fb3d4 (patch) | |
| tree | 42f5f9c57971624310c0e99cf58c4931fc0830da /src | |
| parent | 919ba88413fcc495ebde288960079f6f627eb5b7 (diff) | |
Fix tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/run.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{bail, Result}; use std::io::{stdout, Write}; use crate::exercise::Exercise; @@ -17,11 +17,11 @@ pub fn run(exercise: &Exercise) -> Result<()> { stdout.flush()?; } - if output.status.success() { - success!("Successfully ran {}", exercise); - } else { - warn!("Ran {} with errors", exercise); + if !output.status.success() { + bail!("Ran {exercise} with errors"); } + success!("Successfully ran {}", exercise); + Ok(()) } |
