mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 21:03:51 +03:00
Add test for autoclosing w/ matching start and end char
This commit is contained in:
parent
cb9534eae0
commit
e9073310c4
@ -3039,6 +3039,12 @@ async fn test_autoclose_pairs(cx: &mut gpui::TestAppContext) {
|
||||
close: false,
|
||||
newline: true,
|
||||
},
|
||||
BracketPair {
|
||||
start: "\"".to_string(),
|
||||
end: "\"".to_string(),
|
||||
close: true,
|
||||
newline: false,
|
||||
},
|
||||
],
|
||||
autoclose_before: "})]".to_string(),
|
||||
..Default::default()
|
||||
@ -3159,6 +3165,13 @@ async fn test_autoclose_pairs(cx: &mut gpui::TestAppContext) {
|
||||
cx.set_state("«aˇ» b");
|
||||
cx.update_editor(|view, cx| view.handle_input("{", cx));
|
||||
cx.assert_editor_state("{«aˇ»} b");
|
||||
|
||||
// Autclose pair where the start and end characters are the same
|
||||
cx.set_state("aˇ");
|
||||
cx.update_editor(|view, cx| view.handle_input("\"", cx));
|
||||
cx.assert_editor_state("a\"ˇ\"");
|
||||
cx.update_editor(|view, cx| view.handle_input("\"", cx));
|
||||
cx.assert_editor_state("a\"\"ˇ");
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
|
Loading…
Reference in New Issue
Block a user