mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Add a snippet unit test with an escaped curly brace
This commit is contained in:
parent
7a68b2d371
commit
a137abe2de
@ -189,10 +189,14 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_snippet_parsing_with_escaped_dollar_sign() {
|
||||
fn test_snippet_parsing_with_escaped_chars() {
|
||||
let snippet = Snippet::parse("\"\\$schema\": $1").unwrap();
|
||||
assert_eq!(snippet.text, "\"$schema\": ");
|
||||
assert_eq!(tabstops(&snippet), &[vec![11..11]]);
|
||||
|
||||
let snippet = Snippet::parse("{a\\}").unwrap();
|
||||
assert_eq!(snippet.text, "{a}");
|
||||
assert_eq!(tabstops(&snippet), &[vec![3..3]]);
|
||||
}
|
||||
|
||||
fn tabstops(snippet: &Snippet) -> Vec<Vec<Range<isize>>> {
|
||||
|
Loading…
Reference in New Issue
Block a user