Skip to content

Commit

Permalink
Merge pull request #4 from auronandace/test_coverage
Browse files Browse the repository at this point in the history
implement test coverage for number_length
  • Loading branch information
auronandace authored Dec 9, 2022
2 parents 76c9687 + ec2979a commit d300342
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,14 @@ mod tests {
fn new_numstring() {
assert_eq!(Acorn::num_string(888, 3), String::from("888"));
}
#[test]
fn num_length() {
let mut num: u128 = 1;
let mut size: usize = 1;
for _ in 0..39 {
assert_eq!(Acorn::number_length(num), size);
if size < 39 {num *= 10;}
size += 1;
}
}
}

0 comments on commit d300342

Please sign in to comment.