Put str tests in a nested tests module
This commit is contained in:
parent
104b9b0864
commit
4a0586b1a5
1 changed files with 35 additions and 30 deletions
|
@ -62,8 +62,12 @@ impl CharAt for str {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn index_before_is_well_behaved_for_ascii() {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn index_before_is_well_behaved_for_ascii() {
|
||||
let s = "abc";
|
||||
|
||||
// Sanity
|
||||
|
@ -79,10 +83,10 @@ fn index_before_is_well_behaved_for_ascii() {
|
|||
assert_eq!(last_char.len(), 1);
|
||||
assert_eq!(last_char.chars().nth(0), Some('c'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn index_after_is_well_behaved_for_ascii() {
|
||||
#[test]
|
||||
fn index_after_is_well_behaved_for_ascii() {
|
||||
let s = "abc";
|
||||
|
||||
// Sanity
|
||||
|
@ -95,4 +99,5 @@ fn index_after_is_well_behaved_for_ascii() {
|
|||
assert_eq!(idx, s.len());
|
||||
assert!(s.is_char_boundary(idx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue