Put str tests in a nested tests module

This commit is contained in:
Eryn Wells 2017-04-03 16:55:47 -04:00
parent 104b9b0864
commit 4a0586b1a5

View file

@ -62,8 +62,12 @@ impl CharAt for str {
} }
} }
#[test] #[cfg(test)]
fn index_before_is_well_behaved_for_ascii() { mod tests {
use super::*;
#[test]
fn index_before_is_well_behaved_for_ascii() {
let s = "abc"; let s = "abc";
// Sanity // Sanity
@ -79,10 +83,10 @@ fn index_before_is_well_behaved_for_ascii() {
assert_eq!(last_char.len(), 1); assert_eq!(last_char.len(), 1);
assert_eq!(last_char.chars().nth(0), Some('c')); assert_eq!(last_char.chars().nth(0), Some('c'));
} }
} }
#[test] #[test]
fn index_after_is_well_behaved_for_ascii() { fn index_after_is_well_behaved_for_ascii() {
let s = "abc"; let s = "abc";
// Sanity // Sanity
@ -95,4 +99,5 @@ fn index_after_is_well_behaved_for_ascii() {
assert_eq!(idx, s.len()); assert_eq!(idx, s.len());
assert!(s.is_char_boundary(idx)); assert!(s.is_char_boundary(idx));
} }
}
} }