style: Make starts_with_ignore_ascii_case not lie if the strings are the same length.

This commit is contained in:
Emilio Cobos Álvarez 2017-07-08 19:41:28 +02:00
parent d8a22d8bd7
commit 9e00efc8a5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 7 additions and 1 deletions

View file

@ -34,6 +34,12 @@ pub fn test_str_join_many() {
assert_eq!(actual, expected);
}
#[test]
pub fn test_starts_with_ignore_ascii_case_basic() {
assert!(starts_with_ignore_ascii_case("-webkit-", "-webkit-"));
assert!(starts_with_ignore_ascii_case("-webkit-foo", "-webkit-"));
}
#[test]
pub fn test_starts_with_ignore_ascii_case_char_boundary() {
assert!(!starts_with_ignore_ascii_case("aaaaa💩", "-webkit-"));