Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-is-hate committed Jun 4, 2024
1 parent c3278c6 commit f4a43d4
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1633,9 +1633,9 @@ pub(crate) mod tests {
reserved_range: vec![],
reserved_name: vec![]
};
let file_descriptor = FileDescriptorProto {
name: None,
package: None,
let file_descriptor: FileDescriptorProto = FileDescriptorProto {
name: Some("test_file.proto".to_string()),
package: Some("test_package".to_string()),
dependency: vec![],
public_dependency: vec![],
weak_dependency: vec![],
Expand All @@ -1652,7 +1652,7 @@ pub(crate) mod tests {
method: vec![
MethodDescriptorProto {
name: Some("call".to_string()),
input_type: Some(".google.protobuf.StringValue".to_string()),
input_type: Some("StringValue".to_string()),
output_type: Some("test_message".to_string()),
options: None,
client_streaming: None,
Expand Down Expand Up @@ -1729,8 +1729,8 @@ pub(crate) mod tests {
reserved_name: vec![]
};
let file_descriptor = FileDescriptorProto {
name: None,
package: None,
name: Some("test_file.proto".to_string()),
package: Some("test_package".to_string()),
dependency: vec![],
public_dependency: vec![],
weak_dependency: vec![],
Expand All @@ -1747,7 +1747,7 @@ pub(crate) mod tests {
method: vec![
MethodDescriptorProto {
name: Some("call".to_string()),
input_type: Some(".google.protobuf.StringValue".to_string()),
input_type: Some("StringValue".to_string()),
output_type: Some("test_message".to_string()),
options: None,
client_streaming: None,
Expand Down Expand Up @@ -2057,8 +2057,12 @@ pub(crate) mod tests {
"pact:match": "eachValue(matching($'area'))"
});

let all_descriptors = hashmap!{
"area_calculator.proto".to_string() => &FILE_DESCRIPTOR as &FileDescriptorProto
};

let result = build_embedded_message_field_value(&mut message_builder, &path, &field_descriptor,
"value", &config, &mut matching_rules, &mut generators, &hashmap!{}
"value", &config, &mut matching_rules, &mut generators, &all_descriptors
);

let expected_rules = matchingrules! {
Expand Down Expand Up @@ -2125,9 +2129,11 @@ pub(crate) mod tests {
"shape": "matching(type, 'rectangle')",
"value": "matching(number, 12)"
});

let all_descriptors = hashmap!{
"area_calculator.proto".to_string() => &FILE_DESCRIPTOR as &FileDescriptorProto
};
let result = build_embedded_message_field_value(&mut message_builder, &path, &field_descriptor,
"value", &config, &mut matching_rules, &mut generators, &hashmap!{}
"value", &config, &mut matching_rules, &mut generators, &all_descriptors
);

let expected_rules = matchingrules! {
Expand Down

0 comments on commit f4a43d4

Please sign in to comment.