-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds CLI tests for pest2ion
#45
Conversation
cmd.arg(input_path.to_str().unwrap()); | ||
} | ||
}; | ||
println!("{:?}", cmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to help me visualize the permutations, it is visible if you run cargo
with --show-output
.
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-o" "/tmp/.tmpCJA5m0/OUTPUT.ion", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "/tmp/.tmpIZFcxJ/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-o" "/tmp/.tmpGNdUse/OUTPUT.ion" "/tmp/.tmpGNdUse/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-t", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-t" "-o" "/tmp/.tmpPM4bcq/OUTPUT.ion", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-t" "/tmp/.tmp1HNyMC/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-t" "-o" "/tmp/.tmpM8Nz6P/OUTPUT.ion" "/tmp/.tmpM8Nz6P/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-p", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-p" "-o" "/tmp/.tmpKpsoGP/OUTPUT.ion", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-p" "/tmp/.tmphjCwHT/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-p" "-o" "/tmp/.tmpZDh6Up/OUTPUT.ion" "/tmp/.tmpZDh6Up/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-b", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-b" "-o" "/tmp/.tmpXB9Mqf/OUTPUT.ion", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-b" "/tmp/.tmpcYHp3T/INPUT.pest", stdin: None, timeout: None }
-------------- TEST START --------------
Command { cmd: "/home/ANT.AMAZON.COM/almann/CLionProjects/partiql-lang-rust/target/debug/pest2ion" "-b" "-o" "/tmp/.tmpjHh3fL/OUTPUT.ion" "/tmp/.tmpjHh3fL/INPUT.pest", stdin: None, timeout: None }
Codecov Report
@@ Coverage Diff @@
## main #45 +/- ##
=======================================
Coverage 89.54% 89.54%
=======================================
Files 10 10
Lines 727 727
=======================================
Hits 651 651
Misses 76 76 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
Uses `assert_cmd` and `rstest` to test the different permutations of the `pest2ion` command with real arguments. This includes testing STDIN/STDOUT defaults as well as file arguments using a temporary directory per test case. Each format mode is also permuted. Note that this does not test the "long" argument names, if we care to, we can always add that for completeness. Resolves partiql#42.
337cc8b
to
4e8a2b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
Uses
assert_cmd
andrstest
to test the different permutations of thepest2ion
command with real arguments. This includes testingSTDIN/STDOUT defaults as well as file arguments using a temporary
directory per test case. Each format mode is also permuted.
Note that this does not test the "long" argument names, if we care to,
we can always add that for completeness.
The goal here is to make sure the driver works, not to test the completeness
of the
pest-ion
library crate.Resolves #42.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.