Skip to content

Commit

Permalink
fix: add check to prevent naive implementation of is_international
Browse files Browse the repository at this point in the history
* fix(structs3): Add check to prevent naive implementation

* chore(structs3): Add a missed newline after the test I added
  • Loading branch information
cadolphs authored Mar 12, 2021
1 parent 815edb7 commit 05a753f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions exercises/structs/structs3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ mod tests {
assert!(package.is_international());
}

#[test]
fn create_local_package() {
let sender_country = String::from("Canada");
let recipient_country = sender_country.clone();

let package = Package::new(sender_country, recipient_country, 1200);

assert!(!package.is_international());
}

#[test]
fn calculate_transport_fees() {
let sender_country = String::from("Spain");
Expand Down

0 comments on commit 05a753f

Please sign in to comment.