Add pipe character to allowed word boundaries

This commit is contained in:
Patrick Lühne 2020-02-26 14:04:41 +01:00
parent d5cd179a2d
commit e6a5c20d42
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ fn is_character_word_boundary(c: char) -> bool
| '*'
| '/'
| '%'
| '|'
=> true,
_ => false,
}
@ -71,6 +72,7 @@ mod tests
assert_eq!(word_boundary("*rest"), Ok(("*rest", ())));
assert_eq!(word_boundary("/rest"), Ok(("/rest", ())));
assert_eq!(word_boundary("%rest"), Ok(("%rest", ())));
assert_eq!(word_boundary("|rest"), Ok(("|rest", ())));
assert!(word_boundary("0").is_err());
assert!(word_boundary("rest").is_err());
}