Skip to content

Commit

Permalink
switched from unit tests to 'just' binary tests, updated 'rust-apt' d…
Browse files Browse the repository at this point in the history
…ependency to 'main' branch
  • Loading branch information
tonky committed Oct 3, 2022
1 parent 9e70736 commit 31d2d69
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build:
cargo build

test-root:
just build

sudo chown root target/debug/mist
sudo chmod a+s target/debug/mist

if ./target/debug/mist search nonexistent; then echo "Missing 'search' results should not exit with status code 0" && exit 1; fi

if ./target/debug/mist list nonexistent; then echo "Missing 'list' resulsts should not exit with status code 0" && exit 1; fi
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ makedeb-srcinfo = "0.8.0"
quit = "1.1.4"
regex = "1.6.0"
reqwest = { version = "0.11.11", features = ["blocking", "json"] }
rust-apt = { git = "https://gitlab.com/volian/rust-apt", branch = "fix/tagfile-parsing" }
rust-apt = { git = "https://gitlab.com/volian/rust-apt" }
serde = { version = "1.0.142", features = ["derive"] }
serde_json = "1.0.83"
tempfile = "3.3.0"
Expand Down
4 changes: 4 additions & 0 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ pub fn list(args: &clap::ArgMatches) {
}
}

if candidates.is_empty() {
quit::with_code(exitcode::UNAVAILABLE);
}

print!(
"{}",
style::generate_pkginfo_entries(
Expand Down
4 changes: 4 additions & 0 deletions src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ pub fn search(args: &clap::ArgMatches) {
}
}

if candidates.is_empty() {
quit::with_code(exitcode::UNAVAILABLE);
}

print!(
"{}",
style::generate_pkginfo_entries(
Expand Down

0 comments on commit 31d2d69

Please sign in to comment.