Skip to content

Commit

Permalink
remove reference to a deleted method
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-is-hate committed Jun 3, 2024
1 parent 66b97ca commit c4ac8d7
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,6 @@ pub(crate) mod tests {
use crate::utils::{
as_hex,
find_enum_value_by_name,
find_file_descriptor_for_package,
find_message_type_by_name,
find_nested_type,
is_map_field,
Expand Down Expand Up @@ -916,36 +915,4 @@ pub(crate) mod tests {
let result4 = find_enum_value_by_name(&descriptors, ".routeguide.v3.Feature.TestEnum", "VALUE_ONE");
expect!(result4).to(be_some().value((1, enum1.clone())));
}

#[test]
fn find_file_descriptor_for_package_test() {
let descriptors = "CpAEChdpbXBvcnRlZC9pbXBvcnRlZC5wcm90bxIIaW1wb3J0ZWQiOQoJUmVjdGFuZ2x\
lEhQKBXdpZHRoGAEgASgFUgV3aWR0aBIWCgZsZW5ndGgYAiABKAVSBmxlbmd0aCJIChhSZWN0YW5nbGVMb2NhdGlvblJ\
lcXVlc3QSFAoFd2lkdGgYASABKAVSBXdpZHRoEhYKBmxlbmd0aBgCIAEoBVIGbGVuZ3RoIkgKGVJlY3RhbmdsZUxvY2F0\
aW9uUmVzcG9uc2USKwoIbG9jYXRpb24YASABKAsyDy5pbXBvcnRlZC5Qb2ludFIIbG9jYXRpb24iQQoFUG9pbnQSGgoIb\
GF0aXR1ZGUYASABKAVSCGxhdGl0dWRlEhwKCWxvbmdpdHVkZRgCIAEoBVIJbG9uZ2l0dWRlMmUKCEltcG9ydGVkElkKDE\
dldFJlY3RhbmdsZRIiLmltcG9ydGVkLlJlY3RhbmdsZUxvY2F0aW9uUmVxdWVzdBojLmltcG9ydGVkLlJlY3RhbmdsZUxv\
Y2F0aW9uUmVzcG9uc2UiAEJqChlpby5ncnBjLmV4YW1wbGVzLmltcG9ydGVkQg1JbXBvcnRlZFByb3RvUAFaPGdpdGh1Y\
i5jb20vcGFjdC1mb3VuZGF0aW9uL3BhY3QtZ28vdjIvZXhhbXBsZXMvZ3JwYy9pbXBvcnRlZGIGcHJvdG8zCooECg1wcm\
ltYXJ5LnByb3RvEgdwcmltYXJ5GhdpbXBvcnRlZC9pbXBvcnRlZC5wcm90byJNCglSZWN0YW5nbGUSHwoCbG8YASABKAs\
yDy5pbXBvcnRlZC5Qb2ludFICbG8SHwoCaGkYAiABKAsyDy5pbXBvcnRlZC5Qb2ludFICaGkiZAoYUmVjdGFuZ2xlTG9j\
YXRpb25SZXF1ZXN0EgwKAXgYASABKAVSAXgSDAoBeRgCIAEoBVIBeRIUCgV3aWR0aBgDIAEoBVIFd2lkdGgSFgoGbGVuZ\
3RoGAQgASgFUgZsZW5ndGgiTQoZUmVjdGFuZ2xlTG9jYXRpb25SZXNwb25zZRIwCglyZWN0YW5nbGUYASABKAsyEi5wcml\
tYXJ5LlJlY3RhbmdsZVIJcmVjdGFuZ2xlMmIKB1ByaW1hcnkSVwoMR2V0UmVjdGFuZ2xlEiEucHJpbWFyeS5SZWN0YW5nb\
GVMb2NhdGlvblJlcXVlc3QaIi5wcmltYXJ5LlJlY3RhbmdsZUxvY2F0aW9uUmVzcG9uc2UiAEJnChhpby5ncnBjLmV4YW1\
wbGVzLnByaW1hcnlCDFByaW1hcnlQcm90b1ABWjtnaXRodWIuY29tL3BhY3QtZm91bmRhdGlvbi9wYWN0LWdvL3YyL2V4Y\
W1wbGVzL2dycGMvcHJpbWFyeWIGcHJvdG8z";
let decoded = BASE64.decode(descriptors).unwrap();
let bytes = Bytes::copy_from_slice(decoded.as_slice());
let fds = FileDescriptorSet::decode(bytes).unwrap();
let all: HashMap<String, &FileDescriptorProto> = fds.file
.iter().map(|des| (des.name.clone().unwrap_or_default(), des))
.collect();

let file_descriptor = &fds.file[0];
let primary_descriptor = find_file_descriptor_for_package(".primary", file_descriptor, &all).unwrap();
expect!(primary_descriptor.name).to(be_some().value("primary.proto".to_string()));
let imported_descriptor = find_file_descriptor_for_package("imported", file_descriptor, &all).unwrap();
expect!(imported_descriptor.name).to(be_some().value("imported/imported.proto".to_string()));
}
}

0 comments on commit c4ac8d7

Please sign in to comment.