Created
January 14, 2019 11:29
-
-
Save la10736/5d3d3905ba9988e0b0914e4ee45ebfee to your computer and use it in GitHub Desktop.
rstest_parametrize in binary
This file contains hidden or 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
/target | |
**/*.rs.bk |
This file contains hidden or 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
<component name="ProjectCodeStyleConfiguration"> | |
<code_scheme name="Project" version="173"> | |
<DBN-PSQL> | |
<case-options enabled="false"> | |
<option name="KEYWORD_CASE" value="lower" /> | |
<option name="FUNCTION_CASE" value="lower" /> | |
<option name="PARAMETER_CASE" value="lower" /> | |
<option name="DATATYPE_CASE" value="lower" /> | |
<option name="OBJECT_CASE" value="preserve" /> | |
</case-options> | |
<formatting-settings enabled="false" /> | |
</DBN-PSQL> | |
<DBN-SQL> | |
<case-options enabled="false"> | |
<option name="KEYWORD_CASE" value="lower" /> | |
<option name="FUNCTION_CASE" value="lower" /> | |
<option name="PARAMETER_CASE" value="lower" /> | |
<option name="DATATYPE_CASE" value="lower" /> | |
<option name="OBJECT_CASE" value="preserve" /> | |
</case-options> | |
<formatting-settings enabled="false"> | |
<option name="STATEMENT_SPACING" value="one_line" /> | |
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" /> | |
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> | |
</formatting-settings> | |
</DBN-SQL> | |
</code_scheme> | |
</component> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="Encoding" addBOMForNewFiles="with NO BOM" /> | |
</project> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="CargoProjects"> | |
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" /> | |
</component> | |
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3"> | |
<output url="file://$PROJECT_DIR$/out" /> | |
</component> | |
<component name="RustProjectSettings"> | |
<option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" /> | |
</component> | |
</project> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/rtset_issue2.iml" filepath="$PROJECT_DIR$/rtset_issue2.iml" /> | |
</modules> | |
</component> | |
</project> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="VcsDirectoryMappings"> | |
<mapping directory="" vcs="Git" /> | |
</component> | |
</project> |
This file contains hidden or 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
[[package]] | |
name = "proc-macro2" | |
version = "0.4.24" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
dependencies = [ | |
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "quote" | |
version = "0.6.10" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
dependencies = [ | |
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "rstest" | |
version = "0.2.2" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
dependencies = [ | |
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", | |
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
"syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "rtset_issue2" | |
version = "0.1.0" | |
dependencies = [ | |
"rstest 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "syn" | |
version = "0.14.9" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
dependencies = [ | |
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", | |
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
] | |
[[package]] | |
name = "unicode-xid" | |
version = "0.1.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
[metadata] | |
"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" | |
"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" | |
"checksum rstest 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "17060b44b74f0aed4e7ee6c970e57b5e51adbd3aecd814e1ab38a27e00901d67" | |
"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" | |
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" |
This file contains hidden or 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
[package] | |
name = "rtset_issue2" | |
version = "0.1.0" | |
authors = ["Michele d'Amico <[email protected]>"] | |
edition = "2018" | |
[dev-dependencies] | |
rstest = "*" | |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="RUST_MODULE" version="4"> | |
<component name="NewModuleRootManager" inherit-compiler-output="true"> | |
<exclude-output /> | |
<content url="file://$MODULE_DIR$"> | |
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/examples" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" /> | |
<sourceFolder url="file://$MODULE_DIR$/benches" isTestSource="true" /> | |
<excludeFolder url="file://$MODULE_DIR$/target" /> | |
</content> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
</module> |
This file contains hidden or 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
fn main() { | |
println!("Hello, some world!"); | |
} | |
use rstest::rstest_parametrize; | |
#[cfg(test)] | |
mod test { | |
use super::*; | |
#[rstest_parametrize(a,b,r, | |
case(1,2,3), | |
case(1,3,3) | |
)] | |
fn t(a:i32, b:i32, r:i32) { | |
assert_eq!(r, a+b); | |
} | |
} | |
#[rstest_parametrize( | |
expected, input, | |
case(4, "ciao"), | |
case(3, "Foo") | |
)] | |
fn strlen_test(expected: usize, input: &str) { | |
assert_eq!(expected, input.len()); | |
} |
This file contains hidden or 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
fn main() { | |
println!("Hello, world!"); | |
} | |
use rstest::rstest_parametrize; | |
#[cfg(test)] | |
mod test { | |
use super::*; | |
#[rstest_parametrize(a,b,r, | |
case(1,2,3), | |
case(1,3,3) | |
)] | |
fn t(a:i32, b:i32, r:i32) { | |
assert_eq!(r, a+b); | |
} | |
} | |
#[rstest_parametrize( | |
expected, input, | |
case(4, "ciao"), | |
case(3, "Foo") | |
)] | |
fn strlen_test(expected: usize, input: &str) { | |
assert_eq!(expected, input.len()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment