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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ for historical reference.

### Fixed

- **The workspace builds clean under Rust 1.99's clippy.** Two new
diagnostics turned every `-D warnings` CI job red the day the
toolchain floated: `clippy::assert_is_empty` (pedantic) wants
`assert_eq!(x, [] as [T; 0])` in place of `assert!(x.is_empty())` so
a failure shows the offending contents — 27 test assertions across
17 files now do that — and the future-incompatibility lint
`semicolon_in_expressions_from_non_local_macros` fired on every
closure-position `insta::assert_json_snapshot!` because insta 1.48's
macro ended in a stray `;`. insta 1.49.0 drops it, so both
dev-dependency floors move from `1.29.0` to `1.49.0`; nothing in the
published library changes.
- **A Tcl or iRules braced *value* passed to a script-taking command
no longer reports a `{}` operator** (#1382). #1318 decided the role
of a braced word by the enclosing command's name, which is the whole
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ workspace = true
big-code-analysis-ast = { path = "big-code-analysis-ast", version = "=2.2.1", default-features = false, features = [
"test-support",
] }
insta = { version = "1.29.0", features = ["yaml", "json", "redactions"] }
insta = { version = "1.49.0", features = ["yaml", "json", "redactions"] }
jsonschema = "^0.49"
tempfile.workspace = true
quick-xml = "^0.41"
Expand Down
6 changes: 3 additions & 3 deletions big-code-analysis-ast/src/langs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,9 @@ mod tests {
// `.h` stays on `Cpp` (decision-log #1: asymmetric failure modes).
assert_eq!(get_from_ext("h"), Some(LANG::Cpp));
// The fork claims zero extensions.
assert!(LANG::Mozcpp.extensions().is_empty());
assert!(
!LANG::into_enum_iter().any(|l| l == LANG::Mozcpp && !l.extensions().is_empty()),
assert_eq!(
LANG::Mozcpp.extensions(),
[] as [&str; 0],
"Mozcpp must own no file extension"
);
}
Expand Down
12 changes: 9 additions & 3 deletions big-code-analysis-ast/src/preproc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ fn merge_sorted_ids_yields_one_sorted_copy_of_each_id() {
assert_eq!(out, vec![2, 7]);
// Both empty: the leaf case every closure bottoms out in.
merge_sorted_ids(&[], &[], &mut out);
assert!(out.is_empty());
assert_eq!(out, [] as [usize; 0]);
}

/// The scratch buffer the fold reuses is cleared by `merge_sorted_ids`
Expand Down Expand Up @@ -792,7 +792,10 @@ fn the_closure_is_computed_once_for_the_whole_graph() {
all_files.insert(name.to_string(), vec![PathBuf::from(name)]);
}

assert!(fix_includes(&mut files, &all_files).is_empty());
assert_eq!(
fix_includes(&mut files, &all_files),
[] as [PreprocDiagnostic; 0]
);
// The closure is right, and it took one pass to get there.
assert_eq!(
files
Expand Down Expand Up @@ -834,7 +837,10 @@ fn visible_macros_borrows_exactly_what_get_macros_owns() {
for name in ["a.h", "b.h", "c.h"] {
all_files.insert(name.to_string(), vec![PathBuf::from(name)]);
}
assert!(fix_includes(&mut files, &all_files).is_empty());
assert_eq!(
fix_includes(&mut files, &all_files),
[] as [PreprocDiagnostic; 0]
);

let borrowed = visible_macros(&root, &files);
// `FROM_C` is two hops away, so a closure that stopped at the
Expand Down
12 changes: 9 additions & 3 deletions big-code-analysis-ast/src/tools_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn test_guess_file_no_file_name() {
let all_files: HashMap<String, Vec<PathBuf>> = HashMap::new();
let current = Path::new("/some/file.c");
let result = guess_file(current, "..", &all_files);
assert!(result.is_empty());
assert_eq!(result, [] as [PathBuf; 0]);
}

/// Regression for issue #297: `#include "../foo.h"` from
Expand Down Expand Up @@ -868,7 +868,10 @@ fn resolve_against_parent_returns_none_when_no_parent() {
fn min_distance_candidates_empty_returns_empty() {
let possibilities: Vec<PathBuf> = vec![];
let current = pb("src/main.c");
assert!(min_distance_candidates(&possibilities, &current).is_empty());
assert_eq!(
min_distance_candidates(&possibilities, &current),
[] as [PathBuf; 0]
);
}

#[test]
Expand All @@ -886,7 +889,10 @@ fn min_distance_candidates_excludes_current_path() {
// [current]. This is the invariant that protects guess_file from
// emitting `#include "main.c"` resolving to itself.
let possibilities = vec![current.clone()];
assert!(min_distance_candidates(&possibilities, &current).is_empty());
assert_eq!(
min_distance_candidates(&possibilities, &current),
[] as [PathBuf; 0]
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion big-code-analysis-bench/src/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ mod tests {
fn absent_roots_produce_an_empty_slice() {
let slice = CorpusSlice::from_roots(&[PathBuf::from("/nonexistent/corpus/root")]);
assert!(slice.is_empty());
assert!(slice.roots.is_empty());
assert_eq!(slice.roots, [] as [PathBuf; 0]);
assert_eq!(slice.total_bytes(), 0);
assert!(
slice.summary().contains("empty"),
Expand Down
2 changes: 1 addition & 1 deletion big-code-analysis-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ workspace = true
[dev-dependencies]
assert_cmd = "^2.0"
csv.workspace = true
insta = "1.29.0"
insta = "1.49.0"
jsonschema = "^0.49"
predicates = "^3.0"
quick-xml = "^0.41"
Expand Down
2 changes: 1 addition & 1 deletion big-code-analysis-cli/src/check_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ mod tests {
let mut buf = Vec::new();
write_github_annotations(&mut buf, std::iter::empty(), DEFAULT_GITHUB_ANNOTATION_CAP)
.expect("write");
assert!(buf.is_empty());
assert_eq!(String::from_utf8_lossy(&buf), "");
}

#[cfg(unix)]
Expand Down
3 changes: 1 addition & 2 deletions big-code-analysis-cli/src/exemptions_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ fn json_omitted_sections_are_null_not_empty() {
};
let out = report.render(OutputFormat::Json, "").expect("json render");
let v: Value = serde_json::from_str(&out).expect("valid JSON");
assert!(v["suppressions"]["markers"].is_array());
assert!(v["suppressions"]["markers"].as_array().unwrap().is_empty());
assert_eq!(v["suppressions"]["markers"], serde_json::json!([]));
assert!(v["suppressions"]["excludes"].is_null());
assert!(v["suppressions"]["baseline"].is_null());
}
Expand Down
10 changes: 8 additions & 2 deletions big-code-analysis-cli/src/manifest_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,10 @@ fn sub_table_typos_are_flagged_with_qualified_name() {
);
// `[thresholds]` is validated separately (`split_thresholds_table`),
// so its keys are deliberately not walked here.
assert!(unknown_sub_table_keys("[thresholds]\nbogus = 1\n").is_empty());
assert_eq!(
unknown_sub_table_keys("[thresholds]\nbogus = 1\n"),
[] as [String; 0]
);
}

/// `[report] no_suppress = true` enables the audit view when the CLI
Expand Down Expand Up @@ -743,5 +746,8 @@ fn vcs_is_a_known_manifest_key() {
// A `[vcs]` table must not draw the "ignoring unrecognized key"
// warning (the #409 regression class): every consumed key is listed
// in KNOWN_KEYS.
assert!(unknown_top_level_keys("[vcs]\nfile_types = \"all\"\n").is_empty());
assert_eq!(
unknown_top_level_keys("[vcs]\nfile_types = \"all\"\n"),
[] as [String; 0]
);
}
2 changes: 1 addition & 1 deletion big-code-analysis-cli/src/ordered_stdout_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn consecutive_empty_markers_emit_nothing() {
buffer(&mut pending, 0, None);
buffer(&mut pending, 1, None);

assert!(ready(&mut pending).is_empty());
assert_eq!(ready(&mut pending), [] as [String; 0]);
assert_eq!(pending.next, 2);
}

Expand Down
5 changes: 4 additions & 1 deletion big-code-analysis-cli/src/thresholds_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,10 @@ fn closest_metric_names_returns_empty_for_very_short_input() {
// produce no suggestion. Without this, every short candidate
// would match by trivial substitution.
let names = known_metric_names();
assert!(crate::threshold_suggestion::closest_names("z", &names).is_empty());
assert_eq!(
crate::threshold_suggestion::closest_names("z", &names),
[] as [&str; 0]
);
}

#[test]
Expand Down
6 changes: 5 additions & 1 deletion big-code-analysis-cli/tests/vcs/vcs_rank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ fn vcs_emit_author_details_controls_author_ids() {
assert!(ids(&[]).is_none(), "author_ids key absent by default");
let with = ids(&["--emit-author-details"]).expect("author_ids present under the flag");
let arr = with.as_array().expect("author_ids is an array");
assert!(!arr.is_empty());
assert_ne!(
arr,
&[] as &[serde_json::Value; 0],
"author_ids lists at least one id under the flag"
);
assert!(
arr[0].as_str().is_some_and(|h| h.len() == 64),
"SHA-256 hex"
Expand Down
2 changes: 1 addition & 1 deletion big-code-analysis-py/src/sarif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ mod tests {
let len = names.len();
names.dedup();
assert_eq!(names.len(), len, "metric fields table has duplicates");
assert!(!names.is_empty());
assert_ne!(names, [] as [&str; 0], "metric fields table is empty");
for entry in METRIC_FIELDS {
assert!(
!entry.path.is_empty(),
Expand Down
15 changes: 4 additions & 11 deletions src/output/sarif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,10 @@ mod tests {
let v: serde_json::Value = serde_json::from_str(&out).expect("valid JSON");
assert_eq!(v["version"], "2.1.0");
assert_eq!(v["runs"][0]["tool"]["driver"]["name"], "big-code-analysis");
assert!(
v["runs"][0]["results"]
.as_array()
.expect("array")
.is_empty()
);
assert!(
v["runs"][0]["tool"]["driver"]["rules"]
.as_array()
.expect("array")
.is_empty()
assert_eq!(v["runs"][0]["results"], serde_json::json!([]));
assert_eq!(
v["runs"][0]["tool"]["driver"]["rules"],
serde_json::json!([])
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/spaces_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,7 @@ mod nameless_construct_spaces {
// inner lambda's space sits inside the outer's, not beside it.
assert_eq!(root.spaces.len(), 1);
assert_eq!(root.spaces[0].spaces.len(), 1);
assert!(root.spaces[0].spaces[0].spaces.is_empty());
assert_eq!(root.spaces[0].spaces[0].spaces, [] as [crate::FuncSpace; 0]);
}

/// Sibling constructs with the same synthesised name are allowed to
Expand Down
6 changes: 3 additions & 3 deletions src/suppression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ mod tests {
// allow documentation comments to mention the namespace.
let scan = parse_marker("// bca:");
assert_eq!(scan.suppression, None);
assert!(scan.diagnostics.is_empty());
assert_eq!(scan.diagnostics, [] as [SuppressionError; 0]);
}

#[test]
Expand Down Expand Up @@ -1614,8 +1614,8 @@ mod tests {
#[cfg(feature = "rust")]
#[test]
fn collector_empty_source_yields_no_markers() {
assert!(rust_markers("").is_empty());
assert!(rust_markers("fn f() {}\n").is_empty());
assert_eq!(rust_markers(""), [] as [SuppressionMarker; 0]);
assert_eq!(rust_markers("fn f() {}\n"), [] as [SuppressionMarker; 0]);
}

/// A comment that yields no directive contributes nothing to the
Expand Down
4 changes: 2 additions & 2 deletions src/vcs/bus_factor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn schema_version_is_pinned() {
fn empty_input_yields_zero_everywhere() {
let bf = compute(&[], DEFAULT_COVERAGE_THRESHOLD, false, None);
assert_eq!(bf.repo, GroupBusFactor::default());
assert!(bf.by_directory.is_empty());
assert_eq!(bf.by_directory, [] as [DirectoryBusFactor; 0]);
}

#[test]
Expand Down Expand Up @@ -253,7 +253,7 @@ fn doa_rises_with_first_authorship_and_deliveries_falls_with_accepted() {

#[test]
fn directory_keys_cover_depth_one_and_two_only() {
assert!(directory_keys(Path::new("README.md")).is_empty());
assert_eq!(directory_keys(Path::new("README.md")), [] as [PathBuf; 0]);
assert_eq!(
directory_keys(Path::new("src/lib.rs")),
vec![PathBuf::from("src")]
Expand Down
4 changes: 2 additions & 2 deletions src/vcs/git/identity_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ fn single_paragraph_trailer_only_message_is_counted() {
#[test]
fn ordinary_single_author_message_yields_no_coauthor() {
let msg = "just a normal commit\n\nwith a body paragraph that explains why.";
assert!(coauthor_emails(msg).is_empty());
assert_eq!(coauthor_emails(msg), [] as [String; 0]);
}

#[test]
fn empty_message_yields_no_coauthor() {
assert!(coauthor_emails("").is_empty());
assert_eq!(coauthor_emails(""), [] as [String; 0]);
}

/// Issue #817: `push_if_human` must drop a keyless author so distinct
Expand Down
2 changes: 1 addition & 1 deletion tests/vcs/vcs_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ fn cached_and_uncached_agree_under_emit_author_details() {
.iter()
.find_map(|(_, stats)| stats.author_ids.as_ref())
.expect("some file emitted author ids");
assert!(!stats.is_empty());
assert_ne!(stats, &[] as &[String; 0], "author ids were emitted");
// The emitted ids are full SHA-256 hex digests (64 chars), confirming
// the cache stored digests and replay reproduced them verbatim — not
// some truncated or double-hashed form.
Expand Down
Loading