-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: missing source for some quotes, add tests to prevent this in future
fixes #6
- Loading branch information
Showing
5 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ mod characters; | |
mod format; | ||
mod quote; | ||
mod quotes; | ||
mod quotes_tests; | ||
mod to_str; | ||
|
||
use crate::{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! Tests for `quotes.rs` | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use crate::{quote::Quote, quotes::QUOTES}; | ||
|
||
#[test] | ||
fn dont_contain_unwanted_text() { | ||
const UNWANTED: &[&str] = &[ | ||
"text:", | ||
"char:", | ||
"src:", | ||
"whom_to", | ||
"whom_about", | ||
"\n", | ||
"\t", | ||
]; | ||
for Quote { text, src, .. } in QUOTES { | ||
for unwanted in UNWANTED { | ||
assert!(!text.to_lowercase().contains(unwanted), "unwanted=`{unwanted}`, text=`{text}`"); | ||
assert!(!src.to_lowercase().contains(unwanted), "unwanted=`{unwanted}`, src=`{src}`"); | ||
} | ||
} | ||
} | ||
} |