Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(stats): remove bad prop tests

Elijah Potter2b9578c4e862
diff --git a/Cargo.lock b/Cargo.lock
index 9559845f7..f76d8ef86 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -856,8 +856,6 @@ version = "0.27.0"
dependencies = [
"chrono",
"harper-core",
- "quickcheck",
- "quickcheck_macros",
"serde",
"serde_json",
"uuid",
diff --git a/harper-stats/Cargo.toml b/harper-stats/Cargo.toml
index 1eb18a8ca..325c615d5 100644
--- a/harper-stats/Cargo.toml
+++ b/harper-stats/Cargo.toml
@@ -10,10 +10,6 @@ uuid = { version = "1.12.0", features = ["serde", "v4"] }
serde_json = "1.0.140"
chrono = "0.4.40"
-[dev-dependencies]
-quickcheck = "1.0.3"
-quickcheck_macros = "1.0.0"
-
[features]
default = []
js = ["uuid/js"]
diff --git a/harper-stats/src/lib.rs b/harper-stats/src/lib.rs
index 55e56eef3..d011c9bda 100644
--- a/harper-stats/src/lib.rs
+++ b/harper-stats/src/lib.rs
@@ -83,38 +83,3 @@ impl Default for Stats {
Self::new()
}
}
-
-#[cfg(test)]
-mod tests {
- use std::io::Cursor;
-
- use quickcheck::Arbitrary;
- use quickcheck_macros::quickcheck;
-
- use crate::{Record, Stats};
-
- impl Arbitrary for Stats {
- fn arbitrary(g: &mut quickcheck::Gen) -> Self {
- let mut stats = Stats::new();
-
- for _ in 0..g.size() {
- stats.records.push(Record::arbitrary(g));
- }
-
- stats
- }
- }
-
- #[quickcheck]
- fn io_is_reversible(ex: Stats) -> bool {
- let mut written = Vec::new();
-
- ex.write(&mut written).unwrap();
-
- let mut readable = Cursor::new(written);
-
- let read = Stats::read(&mut readable).unwrap();
-
- ex == read
- }
-}
diff --git a/harper-stats/src/record.rs b/harper-stats/src/record.rs
index 7fe097f4f..15b458b83 100644
--- a/harper-stats/src/record.rs
+++ b/harper-stats/src/record.rs
@@ -45,62 +45,3 @@ impl RecordKind {
}
}
}
-
-#[cfg(test)]
-mod tests {
- use harper_core::{
- linting::{LintGroupConfig, LintKind},
- Document,
- };
- use quickcheck::Arbitrary;
-
- use super::{Record, RecordKind};
-
- fn arbitrary_lintconfig(g: &mut quickcheck::Gen) -> LintGroupConfig {
- let mut config = LintGroupConfig::default();
-
- for _ in 0..g.size() {
- config.set_rule_enabled(String::arbitrary(g), bool::arbitrary(g));
- }
-
- config
- }
-
- impl Arbitrary for RecordKind {
- fn arbitrary(g: &mut quickcheck::Gen) -> Self {
- let lcu = Self::LintConfigUpdate(arbitrary_lintconfig(g));
-
- let context = Document::new_plain_english_curated(&String::arbitrary(g))
- .fat_string_tokens()
- .collect();
-
- let kind = *g
- .choose(&[
- LintKind::Spelling,
- LintKind::Capitalization,
- LintKind::Style,
- LintKind::Formatting,
- LintKind::Repetition,
- LintKind::Enhancement,
- LintKind::Readability,
- LintKind::WordChoice,
- LintKind::Miscellaneous,
- ])
- .unwrap();
-
- g.choose(&[RecordKind::Lint { kind, context }, lcu])
- .unwrap()
- .clone()
- }
- }
-
- impl Arbitrary for Record {
- fn arbitrary(g: &mut quickcheck::Gen) -> Self {
- Record {
- kind: RecordKind::arbitrary(g),
- when: i64::arbitrary(g),
- uuid: uuid::Builder::from_u128(u128::arbitrary(g)).into_uuid(),
- }
- }
- }
-}