-
-
Save newsch/6ec5dfc835c355f7943f55d9c01d88f6 to your computer and use it in GitHub Desktop.
test_case/test_log bug
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
/target |
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 is automatically @generated by Cargo. | |
# It is not intended for manual editing. | |
version = 3 | |
[[package]] | |
name = "aho-corasick" | |
version = "0.7.18" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" | |
dependencies = [ | |
"memchr", | |
] | |
[[package]] | |
name = "atty" | |
version = "0.2.14" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" | |
dependencies = [ | |
"hermit-abi", | |
"libc", | |
"winapi", | |
] | |
[[package]] | |
name = "bar" | |
version = "0.1.0" | |
dependencies = [ | |
"env_logger", | |
"log", | |
"test-case", | |
"test-env-log", | |
"test-log", | |
] | |
[[package]] | |
name = "cfg-if" | |
version = "1.0.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" | |
[[package]] | |
name = "env_logger" | |
version = "0.9.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" | |
dependencies = [ | |
"atty", | |
"humantime", | |
"log", | |
"regex", | |
"termcolor", | |
] | |
[[package]] | |
name = "hermit-abi" | |
version = "0.1.19" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" | |
dependencies = [ | |
"libc", | |
] | |
[[package]] | |
name = "humantime" | |
version = "2.1.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" | |
[[package]] | |
name = "libc" | |
version = "0.2.126" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" | |
[[package]] | |
name = "log" | |
version = "0.4.17" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" | |
dependencies = [ | |
"cfg-if", | |
] | |
[[package]] | |
name = "memchr" | |
version = "2.5.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" | |
[[package]] | |
name = "proc-macro-error" | |
version = "1.0.4" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" | |
dependencies = [ | |
"proc-macro-error-attr", | |
"proc-macro2", | |
"quote", | |
"syn", | |
"version_check", | |
] | |
[[package]] | |
name = "proc-macro-error-attr" | |
version = "1.0.4" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" | |
dependencies = [ | |
"proc-macro2", | |
"quote", | |
"version_check", | |
] | |
[[package]] | |
name = "proc-macro2" | |
version = "1.0.40" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" | |
dependencies = [ | |
"unicode-ident", | |
] | |
[[package]] | |
name = "quote" | |
version = "1.0.20" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" | |
dependencies = [ | |
"proc-macro2", | |
] | |
[[package]] | |
name = "regex" | |
version = "1.5.6" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" | |
dependencies = [ | |
"aho-corasick", | |
"memchr", | |
"regex-syntax", | |
] | |
[[package]] | |
name = "regex-syntax" | |
version = "0.6.26" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" | |
[[package]] | |
name = "syn" | |
version = "1.0.98" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" | |
dependencies = [ | |
"proc-macro2", | |
"quote", | |
"unicode-ident", | |
] | |
[[package]] | |
name = "termcolor" | |
version = "1.1.3" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" | |
dependencies = [ | |
"winapi-util", | |
] | |
[[package]] | |
name = "test-case" | |
version = "2.1.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "196e8a70562e252cc51eaaaee3ecddc39803d9b7fd4a772b7c7dae7cdf42a859" | |
dependencies = [ | |
"test-case-macros", | |
] | |
[[package]] | |
name = "test-case-macros" | |
version = "2.1.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "8dd461f47ade621665c9f4e44b20449341769911c253275dc5cb03726cbb852c" | |
dependencies = [ | |
"cfg-if", | |
"proc-macro-error", | |
"proc-macro2", | |
"quote", | |
"syn", | |
] | |
[[package]] | |
name = "test-env-log" | |
version = "0.2.7" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "b3e4b132a630cc8a0d06cfcb400da67adef3d0087a94b3332d4692908f0c2544" | |
dependencies = [ | |
"proc-macro2", | |
"quote", | |
"syn", | |
] | |
[[package]] | |
name = "test-log" | |
version = "0.2.10" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "4235dbf7ea878b3ef12dea20a59c134b405a66aafc4fc2c7b9935916e289e735" | |
dependencies = [ | |
"proc-macro2", | |
"quote", | |
"syn", | |
] | |
[[package]] | |
name = "unicode-ident" | |
version = "1.0.1" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" | |
[[package]] | |
name = "version_check" | |
version = "0.9.4" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" | |
[[package]] | |
name = "winapi" | |
version = "0.3.9" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" | |
dependencies = [ | |
"winapi-i686-pc-windows-gnu", | |
"winapi-x86_64-pc-windows-gnu", | |
] | |
[[package]] | |
name = "winapi-i686-pc-windows-gnu" | |
version = "0.4.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" | |
[[package]] | |
name = "winapi-util" | |
version = "0.1.5" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" | |
dependencies = [ | |
"winapi", | |
] | |
[[package]] | |
name = "winapi-x86_64-pc-windows-gnu" | |
version = "0.4.0" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" |
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
[package] | |
name = "bar" | |
version = "0.1.0" | |
edition = "2021" | |
[[bin]] | |
name = "main" | |
path = "main.rs" | |
test = true | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
env_logger = "0.9.0" | |
log = "0.4.17" | |
[dev-dependencies] | |
test-case = "=2.1.0" | |
# test-case = "=1.2.0" | |
test-log = "=0.2.10" | |
test-env-log = "=0.2.7" |
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
// running `cargo test` results in duplicate copies of each test/test case | |
fn main() { | |
println!("Hello, world!"); | |
} | |
#[cfg(test)] | |
mod tests { | |
use test_case::test_case; | |
#[test_case(0, 0 ; "the same")] | |
#[test_case(0, 1 ; "different")] | |
#[test_log::test] | |
// #[test_env_log::test] | |
fn equality(a: usize, b: usize) { | |
log::info!("a: {}", a); | |
log::info!("b: {}", b); | |
assert_eq!(a, b) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment