mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
fixed the escape test
This commit is contained in:
parent
9b3d920819
commit
4f5dcbf4c2
1 changed files with 5 additions and 3 deletions
|
@ -4,8 +4,9 @@
|
|||
|
||||
use teloxide_core::types::{User, UserId};
|
||||
|
||||
pub(super) const ESCAPE_CHARS: [char; 19] =
|
||||
['\\', '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!'];
|
||||
pub(super) const ESCAPE_CHARS: [char; 19] = [
|
||||
'\\', '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!',
|
||||
];
|
||||
|
||||
/// Applies the bold font style to the string.
|
||||
///
|
||||
|
@ -247,10 +248,11 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_escape() {
|
||||
assert_eq!(escape("\\!"), r"\\\!");
|
||||
assert_eq!(escape("* foobar *"), r"\* foobar \*");
|
||||
assert_eq!(
|
||||
escape(r"_ * [ ] ( ) ~ \ ` > # + - = | { } . !"),
|
||||
r"\_ \* \[ \] \( \) \~ \ \` \> \# \+ \- \= \| \{ \} \. \!",
|
||||
r"\_ \* \[ \] \( \) \~ \\ \` \> \# \+ \- \= \| \{ \} \. \!",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue