Skip to content

Commit

Permalink
Pin the rev of googletest to the GitHub main branch
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630417312
  • Loading branch information
bjacotg authored and copybara-github committed May 3, 2024
1 parent 353b4e0 commit 7b3682f
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-75f2a85ece6526cc3d54087018c0f1097d78d42b"
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-97f82260fd504923d8af642d567afb2d83a1959d"
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: rust_linux
bazel: >-
Expand Down
72 changes: 39 additions & 33 deletions Cargo.bazel.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"checksum": "f93f5d1848bc00c6384273f9fb5273cc1b7fc0cb4dbc2afd776d2feb7b37f3ae",
"checksum": "8863e5b8f3da7cf4502f68bea0d455dec4834bf25ff070caaa58a8e1c5ea1a3d",
"crates": {
"aho-corasick 1.1.2": {
"name": "aho-corasick",
"version": "1.1.2",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/aho-corasick/1.1.2/download",
"url": "https://static.crates.io/crates/aho-corasick/1.1.2/download",
"sha256": "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
}
},
Expand Down Expand Up @@ -53,7 +53,7 @@
"version": "1.1.0",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/autocfg/1.1.0/download",
"url": "https://static.crates.io/crates/autocfg/1.1.0/download",
"sha256": "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
}
},
Expand Down Expand Up @@ -101,7 +101,7 @@
"deps": {
"common": [
{
"id": "googletest 0.10.0",
"id": "googletest 0.11.0",
"target": "googletest"
}
],
Expand All @@ -121,13 +121,16 @@
},
"license": null
},
"googletest 0.10.0": {
"googletest 0.11.0": {
"name": "googletest",
"version": "0.10.0",
"version": "0.11.0",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/googletest/0.10.0/download",
"sha256": "09213705c85aa0e4b4fff44a3a826a556979a34a266df6bcda703a49c69fb61e"
"Git": {
"remote": "https://github.com/google/googletest-rust",
"commitish": {
"Rev": "471d4a2a8e8bc74f6d7d9c8eecb4d4e3157b2a9f"
},
"strip_prefix": "googletest"
}
},
"targets": [
Expand Down Expand Up @@ -163,7 +166,7 @@
"proc_macro_deps": {
"common": [
{
"id": "googletest_macro 0.10.0",
"id": "googletest_macro 0.11.0",
"target": "googletest_macro"
},
{
Expand All @@ -173,17 +176,20 @@
],
"selects": {}
},
"version": "0.10.0"
"version": "0.11.0"
},
"license": "Apache-2.0"
},
"googletest_macro 0.10.0": {
"googletest_macro 0.11.0": {
"name": "googletest_macro",
"version": "0.10.0",
"version": "0.11.0",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/googletest_macro/0.10.0/download",
"sha256": "005e4cb962c56efd249bdeeb4ac232b11e1c45a2e49793bba2b2982dcc3f2e9d"
"Git": {
"remote": "https://github.com/google/googletest-rust",
"commitish": {
"Rev": "471d4a2a8e8bc74f6d7d9c8eecb4d4e3157b2a9f"
},
"strip_prefix": "googletest_macro"
}
},
"targets": [
Expand All @@ -209,14 +215,14 @@
"target": "quote"
},
{
"id": "syn 2.0.38",
"id": "syn 2.0.43",
"target": "syn"
}
],
"selects": {}
},
"edition": "2021",
"version": "0.10.0"
"version": "0.11.0"
},
"license": "Apache-2.0"
},
Expand All @@ -225,7 +231,7 @@
"version": "2.6.4",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/memchr/2.6.4/download",
"url": "https://static.crates.io/crates/memchr/2.6.4/download",
"sha256": "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
}
},
Expand Down Expand Up @@ -263,7 +269,7 @@
"version": "0.2.17",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/num-traits/0.2.17/download",
"url": "https://static.crates.io/crates/num-traits/0.2.17/download",
"sha256": "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
}
},
Expand Down Expand Up @@ -332,7 +338,7 @@
"version": "1.0.14",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/paste/1.0.14/download",
"url": "https://static.crates.io/crates/paste/1.0.14/download",
"sha256": "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
}
},
Expand Down Expand Up @@ -385,7 +391,7 @@
"version": "1.0.69",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/proc-macro2/1.0.69/download",
"url": "https://static.crates.io/crates/proc-macro2/1.0.69/download",
"sha256": "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
}
},
Expand Down Expand Up @@ -448,7 +454,7 @@
"version": "1.0.33",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/quote/1.0.33/download",
"url": "https://static.crates.io/crates/quote/1.0.33/download",
"sha256": "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
}
},
Expand Down Expand Up @@ -494,7 +500,7 @@
"version": "1.10.0",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/regex/1.10.0/download",
"url": "https://static.crates.io/crates/regex/1.10.0/download",
"sha256": "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87"
}
},
Expand Down Expand Up @@ -567,7 +573,7 @@
"version": "0.4.1",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/regex-automata/0.4.1/download",
"url": "https://static.crates.io/crates/regex-automata/0.4.1/download",
"sha256": "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b"
}
},
Expand Down Expand Up @@ -641,7 +647,7 @@
"version": "0.8.1",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/regex-syntax/0.8.1/download",
"url": "https://static.crates.io/crates/regex-syntax/0.8.1/download",
"sha256": "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33"
}
},
Expand Down Expand Up @@ -686,7 +692,7 @@
"version": "1.0.14",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/rustversion/1.0.14/download",
"url": "https://static.crates.io/crates/rustversion/1.0.14/download",
"sha256": "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
}
},
Expand Down Expand Up @@ -734,13 +740,13 @@
},
"license": "MIT OR Apache-2.0"
},
"syn 2.0.38": {
"syn 2.0.43": {
"name": "syn",
"version": "2.0.38",
"version": "2.0.43",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/syn/2.0.38/download",
"sha256": "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
"url": "https://static.crates.io/crates/syn/2.0.43/download",
"sha256": "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53"
}
},
"targets": [
Expand Down Expand Up @@ -790,7 +796,7 @@
"selects": {}
},
"edition": "2021",
"version": "2.0.38"
"version": "2.0.43"
},
"license": "MIT OR Apache-2.0"
},
Expand All @@ -799,7 +805,7 @@
"version": "1.0.12",
"repository": {
"Http": {
"url": "https://crates.io/api/v1/crates/unicode-ident/1.0.12/download",
"url": "https://static.crates.io/crates/unicode-ident/1.0.12/download",
"sha256": "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
}
},
Expand Down
14 changes: 6 additions & 8 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ crates_repository(
lockfile = "//:Cargo.bazel.lock",
packages = {
"googletest": crate.spec(
version = ">0.0.0",
git = "https://github.com/google/googletest-rust",
rev = "471d4a2a8e8bc74f6d7d9c8eecb4d4e3157b2a9f",
),
"paste": crate.spec(
version = ">=1",
Expand Down
31 changes: 18 additions & 13 deletions rust/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,21 +521,29 @@ mod tests {
assert_that!(
map.as_view().iter().collect::<Vec<_>>(),
unordered_elements_are![
eq((3, ProtoStr::from_str("fizz"))),
eq((5, ProtoStr::from_str("buzz"))),
eq((15, ProtoStr::from_str("fizzbuzz")))
eq(&(3, ProtoStr::from_str("fizz"))),
eq(&(5, ProtoStr::from_str("buzz"))),
eq(&(15, ProtoStr::from_str("fizzbuzz")))
]
);
assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_view(),
unordered_elements_are![
eq((3, ProtoStr::from_str("fizz"))),
eq((5, ProtoStr::from_str("buzz"))),
eq((15, ProtoStr::from_str("fizzbuzz")))
]
);
assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_mut().iter().collect::<Vec<_>>(),
unordered_elements_are![
eq(&(3, ProtoStr::from_str("fizz"))),
eq(&(5, ProtoStr::from_str("buzz"))),
eq(&(15, ProtoStr::from_str("fizzbuzz")))
]
);
assert_that!(
map.as_mut(),
unordered_elements_are![
eq((3, ProtoStr::from_str("fizz"))),
eq((5, ProtoStr::from_str("buzz"))),
Expand All @@ -551,10 +559,7 @@ mod tests {
assert!(map_mut.insert(0, "fizz"));
// insert should return false when the key is already present
assert!(!map_mut.insert(0, "buzz"));
assert_that!(
map.as_mut().iter().collect::<Vec<_>>(),
unordered_elements_are![eq((0, ProtoStr::from_str("buzz"))),]
);
assert_that!(map.as_mut(), unordered_elements_are![eq((0, ProtoStr::from_str("buzz"))),]);
}

#[test]
Expand All @@ -568,7 +573,7 @@ mod tests {
map_mut.extend([(0, "fizz"), (1, "buzz"), (2, "fizzbuzz")]);

assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_view(),
unordered_elements_are![
eq((0, ProtoStr::from_str("fizz"))),
eq((1, ProtoStr::from_str("buzz"))),
Expand All @@ -584,7 +589,7 @@ mod tests {
map_mut.extend(&map_2);

assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_view(),
unordered_elements_are![
eq((0, ProtoStr::from_str("fizz"))),
eq((1, ProtoStr::from_str("buzz"))),
Expand All @@ -601,7 +606,7 @@ mod tests {
map_mut.copy_from([(0, "fizz"), (1, "buzz"), (2, "fizzbuzz")]);

assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_view(),
unordered_elements_are![
eq((0, ProtoStr::from_str("fizz"))),
eq((1, ProtoStr::from_str("buzz"))),
Expand All @@ -617,7 +622,7 @@ mod tests {
map_mut.copy_from(&map_2);

assert_that!(
map.as_view().into_iter().collect::<Vec<_>>(),
map.as_view(),
unordered_elements_are![
eq((2, ProtoStr::from_str("bing"))),
eq((3, ProtoStr::from_str("bong")))
Expand Down
10 changes: 3 additions & 7 deletions rust/repeated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ mod tests {
assert_that!(r.len(), eq(expected_len));

)*
assert_that!(
r.iter().collect::<Vec<$t>>(), elements_are![$(eq($vals)),*]);
assert_that!(r, elements_are![$(eq($vals)),*]);
r.set(0, <$t as Default>::default());
assert_that!(r.get(0).expect("elem 0"), eq(<$t as Default>::default()));

Expand All @@ -507,15 +506,12 @@ mod tests {
assert_that!(r.as_mut().len(), eq(0));

r.as_mut().extend([0, 1]);
assert_that!(r.as_mut().iter().collect::<Vec<_>>(), elements_are![eq(0), eq(1)]);
assert_that!(r.as_mut(), elements_are![eq(0), eq(1)]);
let mut x = Repeated::<i32>::new();
x.as_mut().extend([2, 3]);

r.as_mut().extend(&x.as_mut());

assert_that!(
r.as_mut().iter().collect::<Vec<_>>(),
elements_are![eq(0), eq(1), eq(2), eq(3)]
);
assert_that!(r.as_mut(), elements_are![eq(0), eq(1), eq(2), eq(3)]);
}
}
Loading

0 comments on commit 7b3682f

Please sign in to comment.