mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +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};
|
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.
|
/// Applies the bold font style to the string.
|
||||||
///
|
///
|
||||||
|
@ -247,10 +248,11 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_escape() {
|
fn test_escape() {
|
||||||
|
assert_eq!(escape("\\!"), r"\\\!");
|
||||||
assert_eq!(escape("* foobar *"), r"\* foobar \*");
|
assert_eq!(escape("* foobar *"), r"\* foobar \*");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
escape(r"_ * [ ] ( ) ~ \ ` > # + - = | { } . !"),
|
escape(r"_ * [ ] ( ) ~ \ ` > # + - = | { } . !"),
|
||||||
r"\_ \* \[ \] \( \) \~ \ \` \> \# \+ \- \= \| \{ \} \. \!",
|
r"\_ \* \[ \] \( \) \~ \\ \` \> \# \+ \- \= \| \{ \} \. \!",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue