Skip to content

Commit 05a753f

Browse files
authored
fix: add check to prevent naive implementation of is_international
* fix(structs3): Add check to prevent naive implementation * chore(structs3): Add a missed newline after the test I added
1 parent 815edb7 commit 05a753f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

exercises/structs/structs3.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ mod tests {
5757
assert!(package.is_international());
5858
}
5959

60+
#[test]
61+
fn create_local_package() {
62+
let sender_country = String::from("Canada");
63+
let recipient_country = sender_country.clone();
64+
65+
let package = Package::new(sender_country, recipient_country, 1200);
66+
67+
assert!(!package.is_international());
68+
}
69+
6070
#[test]
6171
fn calculate_transport_fees() {
6272
let sender_country = String::from("Spain");

0 commit comments

Comments
 (0)