-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update crates.io usage for the binary (#53)
* Change the binary name to be written in kebab-case as a distinction to the snake-case library name * Use the crates.io crate for the binary now
- Loading branch information
Showing
3 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,25 @@ use std::process::Command; // Run programs | |
|
||
#[test] | ||
fn arguments() -> Result<(), Box<dyn std::error::Error>> { | ||
let mut cmd = Command::cargo_bin("adf_bdd")?; | ||
let mut cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg("-vvv").arg("--lx").arg("file.txt"); | ||
cmd.assert() | ||
.failure() | ||
.stderr(predicate::str::contains("No such file or directory")); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg("-v").arg("--lx").arg("--an").arg("file.txt"); | ||
cmd.assert().failure().stderr(predicate::str::contains( | ||
"The argument '--lx' cannot be used with '--an'", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg("-h"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"[email protected]", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg("--version"); | ||
cmd.assert() | ||
.success() | ||
|
@@ -38,14 +38,14 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
let wrong_file = assert_fs::NamedTempFile::new("wrong_format.adf")?; | ||
wrong_file.write_str("s(7).s(4).s(8).s(3).s(5).s(9).s(10).s(1).s(6).s(2).ac(7,or(or(and(7,neg(1)),neg(9)),3)).ac(4,5).ac(8,or(or(8,1),neg(7))).ac(3,or(and(or(6,7),neg(and(6,7))),neg(2))).ac(5,c(f)).ac(9,and(neg(7),2)).ac(10,or(neg(2),6)).ac(1,and(or(or(neg(2),neg(1)),8),7)).ac(6,and(and(neg(2),10),and(or(7,4),neg(and(7,4))))).ac(2,and(and(and(neg(10),3),neg(6)),or(9,1)))).")?; | ||
|
||
let mut cmd = Command::cargo_bin("adf_bdd")?; | ||
let mut cmd = Command::cargo_bin("adf-bdd")?; | ||
|
||
cmd.arg(wrong_file.path()); | ||
cmd.assert() | ||
.failure() | ||
.stderr(predicate::str::contains("code: Eof")); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("-vv") | ||
.arg("--grd") | ||
|
@@ -55,7 +55,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("-q") | ||
.arg("--grd") | ||
|
@@ -65,7 +65,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--lx") | ||
.arg("-v") | ||
|
@@ -76,7 +76,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(10) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -87,7 +87,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.env_clear(); | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
|
@@ -98,7 +98,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -110,7 +110,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -124,7 +124,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
|
||
let tempdir = assert_fs::TempDir::new()?; | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -136,7 +136,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -148,7 +148,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(tempdir.path().with_file_name("test.json")) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -159,7 +159,7 @@ fn runs_naive() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--com") | ||
|
@@ -180,45 +180,45 @@ fn runs_biodivine() -> Result<(), Box<dyn std::error::Error>> { | |
let wrong_file = assert_fs::NamedTempFile::new("wrong_format.adf")?; | ||
wrong_file.write_str("s(7).s(4).s(8).s(3).s(5).s(9).s(10).s(1).s(6).s(2).ac(7,or(or(and(7,neg(1)),neg(9)),3)).ac(4,5).ac(8,or(or(8,1),neg(7))).ac(3,or(and(or(6,7),neg(and(6,7))),neg(2))).ac(5,c(f)).ac(9,and(neg(7),2)).ac(10,or(neg(2),6)).ac(1,and(or(or(neg(2),neg(1)),8),7)).ac(6,and(and(neg(2),10),and(or(7,4),neg(and(7,4))))).ac(2,and(and(and(neg(10),3),neg(6)),or(9,1)))).")?; | ||
|
||
let mut cmd = Command::cargo_bin("adf_bdd")?; | ||
let mut cmd = Command::cargo_bin("adf-bdd")?; | ||
|
||
cmd.arg(wrong_file.path()); | ||
cmd.assert() | ||
.failure() | ||
.stderr(predicate::str::contains("code: Eof")); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()).arg("-vv").arg("--grd"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()).arg("-q").arg("--grd"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()).arg("--lx").arg("-v").arg("--grd"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(1) u(10) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()).arg("--an").arg("--grd").arg("--stm"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.env_clear(); | ||
cmd.arg(file.path()).arg("--an").arg("--grd"); | ||
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -228,7 +228,7 @@ fn runs_biodivine() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -237,7 +237,7 @@ fn runs_biodivine() -> Result<(), Box<dyn std::error::Error>> { | |
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--com") | ||
|
@@ -256,14 +256,14 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
let wrong_file = assert_fs::NamedTempFile::new("wrong_format.adf")?; | ||
wrong_file.write_str("s(7).s(4).s(8).s(3).s(5).s(9).s(10).s(1).s(6).s(2).ac(7,or(or(and(7,neg(1)),neg(9)),3)).ac(4,5).ac(8,or(or(8,1),neg(7))).ac(3,or(and(or(6,7),neg(and(6,7))),neg(2))).ac(5,c(f)).ac(9,and(neg(7),2)).ac(10,or(neg(2),6)).ac(1,and(or(or(neg(2),neg(1)),8),7)).ac(6,and(and(neg(2),10),and(or(7,4),neg(and(7,4))))).ac(2,and(and(and(neg(10),3),neg(6)),or(9,1)))).")?; | ||
|
||
let mut cmd = Command::cargo_bin("adf_bdd")?; | ||
let mut cmd = Command::cargo_bin("adf-bdd")?; | ||
|
||
cmd.arg(wrong_file.path()); | ||
cmd.assert() | ||
.failure() | ||
.stderr(predicate::str::contains("code: Eof")); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("-vv") | ||
.arg("--grd") | ||
|
@@ -273,7 +273,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("-q") | ||
.arg("--grd") | ||
|
@@ -283,7 +283,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(7) F(4) u(8) u(3) F(5) u(9) u(10) u(1) u(6) u(2)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--lx") | ||
.arg("-v") | ||
|
@@ -294,7 +294,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(10) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9)", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -305,7 +305,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.env_clear(); | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
|
@@ -316,7 +316,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -328,7 +328,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
|
||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--grd") | ||
|
@@ -339,7 +339,7 @@ fn runs_biodivine_hybrid() -> Result<(), Box<dyn std::error::Error>> { | |
cmd.assert().success().stdout(predicate::str::contains( | ||
"u(1) u(2) u(3) F(4) F(5) u(6) u(7) u(8) u(9) u(10) \n", | ||
)); | ||
cmd = Command::cargo_bin("adf_bdd")?; | ||
cmd = Command::cargo_bin("adf-bdd")?; | ||
cmd.arg(file.path()) | ||
.arg("--an") | ||
.arg("--com") | ||
|