Skip to content

insta: Update snapshots #9929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2024
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
16 changes: 8 additions & 8 deletions crates/crates_io_cdn_logs/src/cloudfront.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mod tests {
let mut cursor = Cursor::new(include_bytes!("../test_data/cloudfront/basic.log"));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected] .. 1
Expand All @@ -157,7 +157,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand All @@ -169,11 +169,11 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-17 [email protected]+zstd.1.5.5 .. 3
}
"###);
");
}

#[tokio::test]
Expand All @@ -185,11 +185,11 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 2
}
"###);
");
}

#[tokio::test]
Expand All @@ -201,11 +201,11 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand Down
12 changes: 6 additions & 6 deletions crates/crates_io_cdn_logs/src/download_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,31 @@ mod tests {

// Add an entry to the map
add(&mut downloads, "xmas", "2.0.0", "2023-12-25");
assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2023-12-25 [email protected] .. 1
}
"###);
");

// Add the same entry again
add(&mut downloads, "xmas", "2.0.0", "2023-12-25");
assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2023-12-25 [email protected] .. 2
}
"###);
");

// Add other entries
add(&mut downloads, "foo", "2.0.0", "2023-12-25");
add(&mut downloads, "xmas", "1.0.0", "2023-12-25");
add(&mut downloads, "xmas", "2.0.0", "2023-12-26");
assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2023-12-25 [email protected] .. 1
2023-12-25 [email protected] .. 1
2023-12-25 [email protected] .. 2
2023-12-26 [email protected] .. 1
}
"###);
");
}
}
4 changes: 2 additions & 2 deletions crates/crates_io_cdn_logs/src/fastly/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod tests {
fn test_parse() {
let input = r#"{"bytes":null,"date_time":"2024-01-16T16:03:04.44007323Z","ip":"45.79.107.220","method":"GET","status":403,"url":"https://static.staging.crates.io/?1705420437","version":"1"}"#;
let output = assert_ok!(serde_json::from_str::<LogLine<'_>>(input));
assert_debug_snapshot!(output, @r###"
assert_debug_snapshot!(output, @r#"
V1(
LogLineV1 {
date_time: 2024-01-16T16:03:04.440073230Z,
Expand All @@ -81,7 +81,7 @@ mod tests {
status: 403,
},
)
"###);
"#);

assert_eq!(
output.date_time().to_string(),
Expand Down
16 changes: 8 additions & 8 deletions crates/crates_io_cdn_logs/src/fastly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod tests {
let mut cursor = Cursor::new(include_bytes!("../../test_data/fastly/basic.log"));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected]+5.3.0-patched .. 1
Expand All @@ -121,7 +121,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand All @@ -133,11 +133,11 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected]+5.3.0-patched .. 2
}
"###);
");
}

#[tokio::test]
Expand All @@ -149,11 +149,11 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 2
}
"###);
");
}

#[tokio::test]
Expand All @@ -165,10 +165,10 @@ mod tests {
));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
}
"###);
");
}
}
16 changes: 8 additions & 8 deletions crates/crates_io_cdn_logs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod tests {
let mut cursor = Cursor::new(include_bytes!("../test_data/cloudfront/basic.log"));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected] .. 1
Expand All @@ -80,7 +80,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand All @@ -94,7 +94,7 @@ mod tests {

let downloads = assert_ok!(count_downloads(reader).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected] .. 1
Expand All @@ -116,7 +116,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand All @@ -126,7 +126,7 @@ mod tests {
let mut cursor = Cursor::new(include_bytes!("../test_data/fastly/basic.log"));
let downloads = assert_ok!(count_downloads(&mut cursor).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected]+5.3.0-patched .. 1
Expand All @@ -151,7 +151,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand All @@ -165,7 +165,7 @@ mod tests {

let downloads = assert_ok!(count_downloads(reader).await);

assert_debug_snapshot!(downloads, @r###"
assert_debug_snapshot!(downloads, @r"
DownloadsMap {
2024-01-16 [email protected] .. 1
2024-01-16 [email protected]+5.3.0-patched .. 1
Expand All @@ -190,7 +190,7 @@ mod tests {
2024-01-17 [email protected] .. 1
2024-01-17 [email protected] .. 1
}
"###);
");
}

#[tokio::test]
Expand Down
8 changes: 4 additions & 4 deletions crates/crates_io_database_dump/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ mod tests {
.map(|entry| entry.unwrap().path().unwrap().display().to_string())
.collect::<Vec<_>>();

assert_debug_snapshot!(paths, @r###"
assert_debug_snapshot!(paths, @r#"
[
"0000-00-00",
"0000-00-00/README.md",
Expand All @@ -269,22 +269,22 @@ mod tests {
"0000-00-00/data/users.csv",
"0000-00-00/data/crate_owners.csv",
]
"###);
"#);

let file = File::open(archives.zip.path()).unwrap();
let reader = BufReader::new(file);

let archive = zip::ZipArchive::new(reader).unwrap();
let zip_paths = archive.file_names().collect::<Vec<_>>();
assert_debug_snapshot!(zip_paths, @r###"
assert_debug_snapshot!(zip_paths, @r#"
[
"README.md",
"data/",
"data/crates.csv",
"data/users.csv",
"data/crate_owners.csv",
]
"###);
"#);
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions ...o_database_dump/src/snapshots/[email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/crates_io_database_dump/src/lib.rs
expression: content
snapshot_kind: text
---
BEGIN ISOLATION LEVEL REPEATABLE READ, READ ONLY;

Expand Down
1 change: 1 addition & 0 deletions ...o_database_dump/src/snapshots/[email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/crates_io_database_dump/src/lib.rs
expression: content
snapshot_kind: text
---
BEGIN;
-- Disable triggers on each table.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: crates/crates_io_index/features.rs
expression: split_features(features)
snapshot_kind: text
---
(
{
Expand Down
Loading