diff options
Diffstat (limited to 'src/libcoretest')
| -rw-r--r-- | src/libcoretest/str.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcoretest/str.rs b/src/libcoretest/str.rs index 9bd7cf9833e..acd8cc42c72 100644 --- a/src/libcoretest/str.rs +++ b/src/libcoretest/str.rs @@ -9,6 +9,16 @@ // except according to those terms. #[test] +fn test_pattern_deref_forward() { + let data = "aabcdaa"; + assert!(data.contains("bcd")); + assert!(data.contains(&"bcd")); + assert!(data.contains(&&"bcd")); + assert!(data.contains(&"bcd".to_string())); + assert!(data.contains(&&"bcd".to_string())); +} + +#[test] fn test_empty_match_indices() { let data = "aä中!"; let vec: Vec<_> = data.match_indices("").collect(); |
