Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions crates/comment-checker/src/strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ mod tests {
);
assert_eq!(plan.source, "def load(path):\n return path\n");
assert_eq!(plan.deleted.len(), 1);
assert!(plan.remaining.is_empty());
assert_eq!(plan.remaining, Vec::<Finding>::new());
}

#[test]
Expand All @@ -143,7 +143,7 @@ mod tests {
)],
);
assert_eq!(plan.source, source);
assert!(plan.deleted.is_empty());
assert_eq!(plan.deleted, Vec::<Finding>::new());
assert_eq!(plan.remaining.len(), 1);
}

Expand All @@ -152,15 +152,15 @@ mod tests {
let source = "x = 1 # TODO: fix this later\n";
let plan = plan_strip(source, &[finding(1, "# TODO: fix this later", None)]);
assert_eq!(plan.source, source);
assert!(plan.deleted.is_empty());
assert_eq!(plan.deleted, Vec::<Finding>::new());
}

#[test]
fn never_cuts_a_shebang() {
let source = "#!/usr/bin/env python3\nx = 1\n";
let plan = plan_strip(source, &[finding(1, "#!/usr/bin/env python3", None)]);
assert_eq!(plan.source, source);
assert!(plan.deleted.is_empty());
assert_eq!(plan.deleted, Vec::<Finding>::new());
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions crates/comment-checker/tests/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ fn restate_cites_lexical_overlap() {
panic!("expected RestatesCode, got {classify:?}");
};
assert_eq!(evidence.lexical, vec!["counter".to_owned()]);
assert!(evidence.operator.is_empty());
assert_eq!(evidence.operator, Vec::<(String, String)>::new());
}

#[test]
Expand Down Expand Up @@ -783,7 +783,7 @@ fn restate_matches_operator_even_without_lexical_overlap() {
else {
panic!("expected RestatesCode, got {classify:?}");
};
assert!(evidence.lexical.is_empty());
assert_eq!(evidence.lexical, Vec::<String>::new());
assert_eq!(
evidence.operator,
vec![("decrements".to_owned(), "-=".to_owned())]
Expand Down Expand Up @@ -846,7 +846,7 @@ fn restates_signature_with_lexical_evidence() {
panic!("expected RestatesCode, got {classify:?}");
};
assert_eq!(evidence.lexical, vec!["user".to_owned()]);
assert!(evidence.operator.is_empty());
assert_eq!(evidence.operator, Vec::<(String, String)>::new());
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/comment-checker/tests/f1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ fn malformed_corpus_fails_loudly() {
fn zero_case_kind_reports_gracefully() {
let report = evaluate(&[], &[]);
assert!(report.by_kind.is_empty());
assert!(per_kind_violations(&report, &[]).is_empty());
assert_eq!(per_kind_violations(&report, &[]), Vec::<String>::new());
}

/// The per-kind floor must trip on a kind-level regression even when the
Expand Down
4 changes: 2 additions & 2 deletions crates/comment-checker/tests/strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn strip_deletes_a_whole_line_comment_and_keeps_the_code() {
assert!(run.stderr.contains("Deleted 1 comment(s)"));
assert!(run.stderr.contains("Do this: rename the identifiers"));
assert!(!run.stderr.contains("Action: delete the flagged comments"));
assert!(run.stdout.is_empty());
assert_eq!(run.stdout, "");
}

#[test]
Expand Down Expand Up @@ -124,7 +124,7 @@ fn strip_on_a_clean_file_is_silent() {
let run = run_binary(&write_payload(&file.path, CLEAN), &["--strip"]);
assert!(run.status.success());
assert_eq!(file.read(), CLEAN);
assert!(run.stderr.is_empty());
assert_eq!(run.stderr, "");
}

#[test]
Expand Down
Loading