@@ -80,7 +80,7 @@ def test_substitute_from_search_history(editor, editor_buffer):
80
80
81
81
82
82
def test_substitute_from_substitute_search_history (editor , editor_buffer ):
83
- given_sample_text (editor_buffer , 'Violet is Violet' )
83
+ given_sample_text (editor_buffer , 'Violet is Violet\n ' )
84
84
85
85
handle_command (editor , ':s/Violet/Rose' )
86
86
assert 'Rose is Violet' in editor_buffer .buffer .text
@@ -100,6 +100,20 @@ def test_substitute_with_repeat_last_substitution(editor, editor_buffer):
100
100
assert 'Rose is Rose' in editor_buffer .buffer .text
101
101
102
102
103
+ def test_substitute_without_replacement_text (editor , editor_buffer ):
104
+ given_sample_text (editor_buffer , 'Violet Violet Violet \n ' )
105
+ editor .application .current_search_state .text = 'Lily'
106
+
107
+ handle_command (editor , ':s/Violet/' )
108
+ assert ' Violet Violet \n ' in editor_buffer .buffer .text
109
+
110
+ handle_command (editor , ':s/Violet' )
111
+ assert ' Violet \n ' in editor_buffer .buffer .text
112
+
113
+ handle_command (editor , ':s/' )
114
+ assert ' \n ' in editor_buffer .buffer .text
115
+
116
+
103
117
def test_substitute_with_repeat_last_substitution_without_previous_substitution (editor , editor_buffer ):
104
118
original_text = 'Violet is blue\n '
105
119
given_sample_text (editor_buffer , original_text )
@@ -118,6 +132,7 @@ def test_substitute_flags_empty_flags(editor, editor_buffer):
118
132
handle_command (editor , ':s/Violet/Rose/' )
119
133
assert 'Rose is Violet' in editor_buffer .buffer .text
120
134
135
+
121
136
def test_substitute_flags_g (editor , editor_buffer ):
122
137
given_sample_text (editor_buffer , 'Violet is Violet\n ' )
123
138
handle_command (editor , ':s/Violet/Rose/g' )
0 commit comments