Skip to content

Commit

Permalink
test(core): boundary for SpelledNumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Dec 20, 2024
1 parent f5ffa74 commit 0535b80
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion harper-core/src/linting/spelled_numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ fn spell_out_number(num: u64) -> Option<String> {

#[cfg(test)]
mod tests {
use super::spell_out_number;
use crate::linting::tests::assert_suggestion_result;

use super::{spell_out_number, SpelledNumbers};

#[test]
fn produces_fifty_three() {
Expand All @@ -91,4 +93,14 @@ mod tests {
fn produces_eighty_two() {
assert_eq!(spell_out_number(82), Some("eighty two".to_string()))
}

#[test]
fn corrects_ten() {
assert_suggestion_result("There are 10 pigs.", SpelledNumbers, "There are ten pigs.");
}

#[test]
fn does_not_correct_eleven() {
assert_suggestion_result("There are 11 pigs.", SpelledNumbers, "There are 11 pigs.");
}
}

0 comments on commit 0535b80

Please sign in to comment.