From 319a2aa031990d824abbf246a03435becc2795b9 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Wed, 4 Oct 2023 16:34:12 +0200 Subject: [PATCH] Add test --- Cargo.lock | 9 --------- symbolic-debuginfo/src/sourcebundle.rs | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39d07687..32182d01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -658,15 +658,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "frame-dedupe" -version = "0.1.0" -dependencies = [ - "indexmap 1.9.3", - "serde", - "serde_json", -] - [[package]] name = "from_variant" version = "0.1.6" diff --git a/symbolic-debuginfo/src/sourcebundle.rs b/symbolic-debuginfo/src/sourcebundle.rs index 0f459371..c395f0d9 100644 --- a/symbolic-debuginfo/src/sourcebundle.rs +++ b/symbolic-debuginfo/src/sourcebundle.rs @@ -1433,6 +1433,22 @@ mod tests { Ok(()) } + #[test] + fn test_non_utf8() -> Result<(), SourceBundleError> { + let writer = Cursor::new(Vec::new()); + let mut bundle = SourceBundleWriter::start(writer)?; + + assert!(bundle + .add_file( + "bar.txt", + &[0, 159, 146, 150][..], + SourceFileInfo::default() + ) + .is_err()); + + Ok(()) + } + #[test] fn test_duplicate_files() -> Result<(), SourceBundleError> { let writer = Cursor::new(Vec::new());