Skip to content

Commit

Permalink
Add simple prop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jul 7, 2024
1 parent 803ff73 commit 2f1ae24
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/prop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use phonenumber::parse;
use proptest::prelude::*;

proptest! {
#[test]
fn doesnt_crash(s in "\\PC*") {
let _ = parse(None, &s);
}

#[test]
fn parse_belgian_phonenumbers(s in "\\+32[0-9]{8,9}") {
let parsed = parse(None, &s).expect("valid Belgian number");
prop_assert_eq!(parsed.country().id(), phonenumber::country::BE.into());
}
}

0 comments on commit 2f1ae24

Please sign in to comment.