Skip to content

Commit

Permalink
test(depinfo): ensure v0 to fail without crashing
Browse files Browse the repository at this point in the history
On macOS it doesn't seem to OOM-kill our program.
On Linux we do get a OOM-killed.
  • Loading branch information
weihanglo committed Oct 30, 2024
1 parent 1fcf5ee commit ab9b672
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Output generated from src/doc/man
#
# The goal is to help people find the right file to edit
src/cargo/core/compiler/fingerprint/dep-lib-cargo_test_macro
src/doc/man/generated_txt
src/doc/src/commands/*
src/etc/man
Expand Down
Binary file not shown.
7 changes: 7 additions & 0 deletions src/cargo/core/compiler/fingerprint/dep_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,4 +667,11 @@ mod encoded_dep_info {
fn round_trip_with_checksums() {
gen_test(true);
}

#[test]
#[cfg_attr(target_os = "linux", ignore = "OOM on Linux")]
fn parse_v0_fingerprint_dep_info() {
let data = include_bytes!("dep-lib-cargo_test_macro");
dbg!(EncodedDepInfo::parse(&data[..]).is_none());
}
}

0 comments on commit ab9b672

Please sign in to comment.