Skip to content

Commit 34677b5

Browse files
authored
Merge pull request #11431 from rust-lang/renovate/googletest-0.x
Update Rust crate googletest to v0.14.2
2 parents cb3f6b9 + 68050c7 commit 34677b5

File tree

21 files changed

+69
-69
lines changed

21 files changed

+69
-69
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ crates_io_test_db = { path = "crates/crates_io_test_db" }
148148
crates_io_trustpub = { path = "crates/crates_io_trustpub", features = ["test-helpers"] }
149149
claims = "=0.8.0"
150150
diesel = { version = "=2.2.11", features = ["r2d2"] }
151-
googletest = "=0.14.1"
151+
googletest = "=0.14.2"
152152
insta = { version = "=1.43.1", features = ["glob", "json", "redactions"] }
153153
jsonwebtoken = "=9.3.1"
154154
quoted_printable = "=0.5.1"

crates/crates_io_database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ utoipa = { version = "=5.4.0", features = ["chrono"] }
3131
claims = "=0.8.0"
3232
crates_io_test_db = { path = "../crates_io_test_db" }
3333
diesel-async = { version = "=0.5.2", features = ["postgres"] }
34-
googletest = "=0.14.1"
34+
googletest = "=0.14.2"
3535
insta = "=1.43.1"
3636
tokio = { version = "=1.45.1", features = ["macros", "rt"] }

src/tests/github_secret_scanning.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async fn github_secret_alert_revokes_token() {
152152
.load(&mut conn)
153153
.await
154154
);
155-
assert_that!(tokens, empty());
155+
assert_that!(tokens, is_empty());
156156

157157
let tokens: Vec<ApiToken> = assert_ok!(
158158
ApiToken::belonging_to(user.as_model())
@@ -216,7 +216,7 @@ async fn github_secret_alert_for_revoked_token() {
216216
.load(&mut conn)
217217
.await
218218
);
219-
assert_that!(tokens, empty());
219+
assert_that!(tokens, is_empty());
220220

221221
let tokens: Vec<ApiToken> = assert_ok!(
222222
ApiToken::belonging_to(user.as_model())

src/tests/krate/following.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async fn test_following() {
9191
assert_that!(user.search("").await.crates, len(eq(1)));
9292
// see https://github.com/jplatte/serde_html_form/issues/13
9393
assert_that!(user.search("following").await.crates, len(eq(1)));
94-
assert_that!(user.search("following=1").await.crates, empty());
94+
assert_that!(user.search("following=1").await.crates, is_empty());
9595

9696
// Unfollow the crate again and check that this call is also idempotent.
9797
unfollow(CRATE_NAME, &user).await;

src/tests/krate/publish/auth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ async fn new_wrong_token() {
2828
let response = token.publish_crate(crate_to_publish).await;
2929
assert_snapshot!(response.status(), @"403 Forbidden");
3030
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"authentication failed"}]}"#);
31-
assert_that!(app.stored_files().await, empty());
32-
assert_that!(app.emails().await, empty());
31+
assert_that!(app.stored_files().await, is_empty());
32+
assert_that!(app.emails().await, is_empty());
3333
}
3434

3535
#[tokio::test(flavor = "multi_thread")]
@@ -51,8 +51,8 @@ async fn new_krate_wrong_user() {
5151
assert_snapshot!(response.status(), @"403 Forbidden");
5252
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"this crate exists but you don't seem to be an owner. If you believe this is a mistake, perhaps you need to accept an invitation to be an owner before publishing."}]}"#);
5353

54-
assert_that!(app.stored_files().await, empty());
55-
assert_that!(app.emails().await, empty());
54+
assert_that!(app.stored_files().await, is_empty());
55+
assert_that!(app.emails().await, is_empty());
5656
}
5757

5858
#[tokio::test(flavor = "multi_thread")]

src/tests/krate/publish/basics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async fn new_krate_duplicate_version() {
158158
assert_snapshot!(response.status(), @"400 Bad Request");
159159
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"crate version `1.0.0` is already uploaded"}]}"#);
160160

161-
assert_that!(app.stored_files().await, empty());
161+
assert_that!(app.stored_files().await, is_empty());
162162
}
163163

164164
#[tokio::test(flavor = "multi_thread")]

src/tests/krate/publish/categories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ async fn too_many_categories() {
5454
.await;
5555
assert_snapshot!(response.status(), @"400 Bad Request");
5656
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"expected at most 5 categories per crate"}]}"#);
57-
assert_that!(app.stored_files().await, empty());
57+
assert_that!(app.stored_files().await, is_empty());
5858
}

src/tests/krate/publish/deleted_crates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async fn test_recently_deleted_crate_with_same_name() -> anyhow::Result<()> {
3232
let response = token.publish_crate(crate_to_publish).await;
3333
assert_snapshot!(response.status(), @"400 Bad Request");
3434
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"A crate with the name `actix_web` was recently deleted. Reuse of this name will be available after 2099-12-25T12:34:56Z."}]}"#);
35-
assert_that!(app.stored_files().await, empty());
35+
assert_that!(app.stored_files().await, is_empty());
3636

3737
Ok(())
3838
}

src/tests/krate/publish/dependencies.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async fn invalid_dependency_name() {
1212
.await;
1313
assert_snapshot!(response.status(), @"400 Bad Request");
1414
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `🦀` in dependency name: `🦀`, the first character must be an ASCII character"}]}"#);
15-
assert_that!(app.stored_files().await, empty());
15+
assert_that!(app.stored_files().await, is_empty());
1616
}
1717

1818
#[tokio::test(flavor = "multi_thread")]
@@ -52,7 +52,7 @@ async fn invalid_dependency_rename() {
5252
.await;
5353
assert_snapshot!(response.status(), @"400 Bad Request");
5454
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `💩` in dependency name: `💩`, the first character must be an ASCII character, or `_`"}]}"#);
55-
assert_that!(app.stored_files().await, empty());
55+
assert_that!(app.stored_files().await, is_empty());
5656
}
5757

5858
#[tokio::test(flavor = "multi_thread")]
@@ -73,7 +73,7 @@ async fn invalid_dependency_name_starts_with_digit() {
7373
.await;
7474
assert_snapshot!(response.status(), @"400 Bad Request");
7575
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"the name `1-foo` cannot be used as a dependency name, the name cannot start with a digit"}]}"#);
76-
assert_that!(app.stored_files().await, empty());
76+
assert_that!(app.stored_files().await, is_empty());
7777
}
7878

7979
#[tokio::test(flavor = "multi_thread")]
@@ -94,7 +94,7 @@ async fn invalid_dependency_name_contains_unicode_chars() {
9494
.await;
9595
assert_snapshot!(response.status(), @"400 Bad Request");
9696
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `🦀` in dependency name: `foo-🦀-bar`, characters must be an ASCII alphanumeric characters, `-`, or `_`"}]}"#);
97-
assert_that!(app.stored_files().await, empty());
97+
assert_that!(app.stored_files().await, is_empty());
9898
}
9999

100100
#[tokio::test(flavor = "multi_thread")]
@@ -115,7 +115,7 @@ async fn invalid_too_long_dependency_name() {
115115
.await;
116116
assert_snapshot!(response.status(), @"400 Bad Request");
117117
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"the dependency name `fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff` is too long (max 64 characters)"}]}"#);
118-
assert_that!(app.stored_files().await, empty());
118+
assert_that!(app.stored_files().await, is_empty());
119119
}
120120

121121
#[tokio::test(flavor = "multi_thread")]
@@ -136,7 +136,7 @@ async fn empty_dependency_name() {
136136
.await;
137137
assert_snapshot!(response.status(), @"400 Bad Request");
138138
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"dependency name cannot be empty"}]}"#);
139-
assert_that!(app.stored_files().await, empty());
139+
assert_that!(app.stored_files().await, is_empty());
140140
}
141141

142142
#[tokio::test(flavor = "multi_thread")]
@@ -212,7 +212,7 @@ async fn new_krate_with_broken_dependency_requirement() {
212212
let response = token.publish_crate(crate_to_publish).await;
213213
assert_snapshot!(response.status(), @"400 Bad Request");
214214
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"\"broken\" is an invalid version requirement"}]}"#);
215-
assert_that!(app.stored_files().await, empty());
215+
assert_that!(app.stored_files().await, is_empty());
216216
}
217217

218218
#[tokio::test(flavor = "multi_thread")]
@@ -232,7 +232,7 @@ async fn reject_new_krate_with_non_exact_dependency() {
232232
let response = token.publish_crate(crate_to_publish).await;
233233
assert_snapshot!(response.status(), @"400 Bad Request");
234234
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"no known crate named `foo_dep`"}]}"#);
235-
assert_that!(app.stored_files().await, empty());
235+
assert_that!(app.stored_files().await, is_empty());
236236
}
237237

238238
#[tokio::test(flavor = "multi_thread")]
@@ -261,7 +261,7 @@ async fn reject_new_crate_with_alternative_registry_dependency() {
261261
let response = token.publish_crate(crate_to_publish).await;
262262
assert_snapshot!(response.status(), @"400 Bad Request");
263263
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"Dependency `dep` is hosted on another registry. Cross-registry dependencies are not permitted on crates.io."}]}"#);
264-
assert_that!(app.stored_files().await, empty());
264+
assert_that!(app.stored_files().await, is_empty());
265265
}
266266

267267
#[tokio::test(flavor = "multi_thread")]
@@ -281,7 +281,7 @@ async fn new_krate_with_wildcard_dependency() {
281281
let response = token.publish_crate(crate_to_publish).await;
282282
assert_snapshot!(response.status(), @"400 Bad Request");
283283
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"wildcard (`*`) dependency constraints are not allowed on crates.io. Crate with this problem: `foo_wild` See https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies for more information"}]}"#);
284-
assert_that!(app.stored_files().await, empty());
284+
assert_that!(app.stored_files().await, is_empty());
285285
}
286286

287287
#[tokio::test(flavor = "multi_thread")]
@@ -313,7 +313,7 @@ async fn new_krate_with_patch() {
313313
let response = token.publish_crate(crate_to_publish).await;
314314
assert_snapshot!(response.status(), @"400 Bad Request");
315315
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"failed to parse `Cargo.toml` manifest file\n\ncrates cannot be published with `[patch]` tables"}]}"#);
316-
assert_that!(app.stored_files().await, empty());
316+
assert_that!(app.stored_files().await, is_empty());
317317
}
318318

319319
#[tokio::test(flavor = "multi_thread")]
@@ -328,7 +328,7 @@ async fn new_krate_dependency_missing() {
328328
let response = token.publish_crate(crate_to_publish).await;
329329
assert_snapshot!(response.status(), @"400 Bad Request");
330330
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"no known crate named `bar_missing`"}]}"#);
331-
assert_that!(app.stored_files().await, empty());
331+
assert_that!(app.stored_files().await, is_empty());
332332
}
333333

334334
#[tokio::test(flavor = "multi_thread")]
@@ -369,7 +369,7 @@ async fn invalid_feature_name() {
369369
.await;
370370
assert_snapshot!(response.status(), @"400 Bad Request");
371371
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `🍺` in feature `🍺`, the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)"}]}"#);
372-
assert_that!(app.stored_files().await, empty());
372+
assert_that!(app.stored_files().await, is_empty());
373373
}
374374

375375
#[tokio::test(flavor = "multi_thread")]

src/tests/krate/publish/emails.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ async fn new_krate_without_any_email_fails() {
1919
let response = token.publish_crate(crate_to_publish).await;
2020
assert_snapshot!(response.status(), @"400 Bad Request");
2121
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"A verified email address is required to publish crates to crates.io. Visit https://crates.io/settings/profile to set and verify your email address."}]}"#);
22-
assert_that!(app.stored_files().await, empty());
23-
assert_that!(app.emails().await, empty());
22+
assert_that!(app.stored_files().await, is_empty());
23+
assert_that!(app.emails().await, is_empty());
2424
}
2525

2626
#[tokio::test(flavor = "multi_thread")]
@@ -39,6 +39,6 @@ async fn new_krate_with_unverified_email_fails() {
3939
let response = token.publish_crate(crate_to_publish).await;
4040
assert_snapshot!(response.status(), @"400 Bad Request");
4141
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"A verified email address is required to publish crates to crates.io. Visit https://crates.io/settings/profile to set and verify your email address."}]}"#);
42-
assert_that!(app.stored_files().await, empty());
43-
assert_that!(app.emails().await, empty());
42+
assert_that!(app.stored_files().await, is_empty());
43+
assert_that!(app.emails().await, is_empty());
4444
}

src/tests/krate/publish/features.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async fn invalid_feature_name1() {
7272
let response = token.publish_crate(crate_to_publish).await;
7373
assert_snapshot!(response.status(), @"400 Bad Request");
7474
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `~` in feature `~foo`, the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)"}]}"#);
75-
assert_that!(app.stored_files().await, empty());
75+
assert_that!(app.stored_files().await, is_empty());
7676
}
7777

7878
#[tokio::test(flavor = "multi_thread")]
@@ -83,7 +83,7 @@ async fn invalid_feature_name2() {
8383
let response = token.publish_crate(crate_to_publish).await;
8484
assert_snapshot!(response.status(), @"400 Bad Request");
8585
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"invalid character `!` in feature `!bar`, the first character must be a Unicode XID start character or digit (most letters or `_` or `0` to `9`)"}]}"#);
86-
assert_that!(app.stored_files().await, empty());
86+
assert_that!(app.stored_files().await, is_empty());
8787
}
8888

8989
#[tokio::test(flavor = "multi_thread")]
@@ -114,7 +114,7 @@ async fn too_many_features() {
114114
let response = token.publish_crate(publish_builder).await;
115115
assert_snapshot!(response.status(), @"400 Bad Request");
116116
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"crates.io only allows a maximum number of 3 features, but your crate is declaring 5 features.\n\nTake a look at https://blog.rust-lang.org/2023/10/26/broken-badges-and-23k-keywords.html to understand why this restriction was introduced.\n\nIf you have a use case that requires an increase of this limit, please send us an email to [email protected] to discuss the details."}]}"#);
117-
assert_that!(app.stored_files().await, empty());
117+
assert_that!(app.stored_files().await, is_empty());
118118
}
119119

120120
#[tokio::test(flavor = "multi_thread")]
@@ -142,7 +142,7 @@ async fn too_many_features_with_custom_limit() {
142142
let response = token.publish_crate(publish_builder).await;
143143
assert_snapshot!(response.status(), @"400 Bad Request");
144144
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"crates.io only allows a maximum number of 4 features, but your crate is declaring 5 features.\n\nTake a look at https://blog.rust-lang.org/2023/10/26/broken-badges-and-23k-keywords.html to understand why this restriction was introduced.\n\nIf you have a use case that requires an increase of this limit, please send us an email to [email protected] to discuss the details."}]}"#);
145-
assert_that!(app.stored_files().await, empty());
145+
assert_that!(app.stored_files().await, is_empty());
146146

147147
let publish_builder = PublishBuilder::new("foo", "1.0.0")
148148
.feature("one", &[])
@@ -174,7 +174,7 @@ async fn too_many_enabled_features() {
174174
let response = token.publish_crate(publish_builder).await;
175175
assert_snapshot!(response.status(), @"400 Bad Request");
176176
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"crates.io only allows a maximum number of 3 features or dependencies that another feature can enable, but the \"default\" feature of your crate is enabling 5 features or dependencies.\n\nTake a look at https://blog.rust-lang.org/2023/10/26/broken-badges-and-23k-keywords.html to understand why this restriction was introduced.\n\nIf you have a use case that requires an increase of this limit, please send us an email to [email protected] to discuss the details."}]}"#);
177-
assert_that!(app.stored_files().await, empty());
177+
assert_that!(app.stored_files().await, is_empty());
178178
}
179179

180180
#[tokio::test(flavor = "multi_thread")]
@@ -198,7 +198,7 @@ async fn too_many_enabled_features_with_custom_limit() {
198198
let response = token.publish_crate(publish_builder).await;
199199
assert_snapshot!(response.status(), @"400 Bad Request");
200200
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"crates.io only allows a maximum number of 4 features or dependencies that another feature can enable, but the \"default\" feature of your crate is enabling 5 features or dependencies.\n\nTake a look at https://blog.rust-lang.org/2023/10/26/broken-badges-and-23k-keywords.html to understand why this restriction was introduced.\n\nIf you have a use case that requires an increase of this limit, please send us an email to [email protected] to discuss the details."}]}"#);
201-
assert_that!(app.stored_files().await, empty());
201+
assert_that!(app.stored_files().await, is_empty());
202202

203203
let publish_builder =
204204
PublishBuilder::new("foo", "1.0.0").feature("default", &["one", "two", "three", "four"]);

src/tests/krate/publish/keywords.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ async fn too_many_keywords() {
5454
.await;
5555
assert_snapshot!(response.status(), @"400 Bad Request");
5656
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"expected at most 5 keywords per crate"}]}"#);
57-
assert_that!(app.stored_files().await, empty());
57+
assert_that!(app.stored_files().await, is_empty());
5858
}

src/tests/krate/publish/max_size.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async fn tarball_bigger_than_max_upload_size() {
9191
let response = token.publish_crate(body).await;
9292
assert_snapshot!(response.status(), @"413 Payload Too Large");
9393
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"max upload size is: 5242880"}]}"#);
94-
assert_that!(app.stored_files().await, empty());
94+
assert_that!(app.stored_files().await, is_empty());
9595
}
9696

9797
#[tokio::test(flavor = "multi_thread")]
@@ -110,7 +110,7 @@ async fn new_krate_gzip_bomb() {
110110
let response = token.publish_crate(crate_to_publish).await;
111111
assert_snapshot!(response.status(), @"400 Bad Request");
112112
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"uploaded tarball is malformed or too large when decompressed"}]}"#);
113-
assert_that!(app.stored_files().await, empty());
113+
assert_that!(app.stored_files().await, is_empty());
114114
}
115115

116116
#[tokio::test(flavor = "multi_thread")]
@@ -129,7 +129,7 @@ async fn new_krate_too_big() {
129129
let response = user.publish_crate(builder).await;
130130
assert_snapshot!(response.status(), @"400 Bad Request");
131131
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"uploaded tarball is malformed or too large when decompressed"}]}"#);
132-
assert_that!(app.stored_files().await, empty());
132+
assert_that!(app.stored_files().await, is_empty());
133133
}
134134

135135
#[tokio::test(flavor = "multi_thread")]

0 commit comments

Comments
 (0)