From 07cfc036b7445c715cc429421e0f0d79d08b659e Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Fri, 12 Aug 2022 19:06:13 +0800 Subject: [PATCH] chore: add slow test config --- crates/rle/src/rle_tree/test/string_fuzzy.rs | 16 +++++++++++++++- justfile | 8 ++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/crates/rle/src/rle_tree/test/string_fuzzy.rs b/crates/rle/src/rle_tree/test/string_fuzzy.rs index 833430ab..889c1012 100644 --- a/crates/rle/src/rle_tree/test/string_fuzzy.rs +++ b/crates/rle/src/rle_tree/test/string_fuzzy.rs @@ -233,7 +233,7 @@ impl Interaction { } } -#[cfg(not(no_prop_test))] +#[cfg(not(no_proptest))] mod string_prop_test { use super::*; use proptest::prelude::*; @@ -272,4 +272,18 @@ mod string_prop_test { } } } + + #[cfg(slow_proptest)] + proptest! { + #[test] + fn test_tree_string_op_the_same_slow( + interactions in prop::collection::vec(gen_interaction(), 1..2000), + ) { + let mut s = String::new(); + let mut tree = RleTree::default(); + for interaction in interactions { + interaction.test_assert(&mut s, &mut tree); + } + } + } } diff --git a/justfile b/justfile index e5285dc0..9b1c81ff 100644 --- a/justfile +++ b/justfile @@ -5,8 +5,12 @@ test *FLAGS: RUST_BACKTRACE=full cargo nextest run {{FLAGS}} # test without proptest -test-fast: - RUSTFLAGS='--cfg no_proptest' cargo nextest run +test-fast *FLAGS: + RUSTFLAGS='--cfg no_prop_test' cargo nextest run {{FLAGS}} + +# test with slower proptest +test-slow *FLAGS: + RUSTFLAGS='--cfg slow_proptest' cargo nextest run {{FLAGS}} check-unsafe: env RUSTFLAGS="-Funsafe-code --cap-lints=warn" cargo check