summaryrefslogtreecommitdiff
path: root/exercises/structs/structs3.rs
diff options
context:
space:
mode:
authorcadolphs <clemens.adolphs@gmail.com>2021-03-12 09:36:35 -0800
committerGitHub <noreply@github.com>2021-03-12 18:36:35 +0100
commit05a753fe6333d36dbee5f68c21dec04eacdc75df (patch)
tree14ee9afd64691ebcfa8b3405547a116e95da4677 /exercises/structs/structs3.rs
parent815edb7003c58f60c6baecb7d91cd72614be7ad6 (diff)
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
Diffstat (limited to 'exercises/structs/structs3.rs')
-rw-r--r--exercises/structs/structs3.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/exercises/structs/structs3.rs b/exercises/structs/structs3.rs
index 06fcaf2..f18cc92 100644
--- a/exercises/structs/structs3.rs
+++ b/exercises/structs/structs3.rs
@@ -58,6 +58,16 @@ mod tests {
}
#[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");
let recipient_country = String::from("Spain");