@@ -25,19 +25,31 @@ local get_lines = function()
2525 return child .api .nvim_buf_get_lines (0 , 0 , - 1 , true )
2626end
2727
28- T [" text_actions" ] = MiniTest .new_set ({
29- n_retry = 3 ,
28+ T [" f-string" ] = MiniTest .new_set ({
3029 hooks = {
3130 pre_case = function ()
3231 child .cmd (" e _not_existing_new_buffer.py" )
32+ child .type_keys (" cc" , [[ "TEST"]] , " <Esc>" , " 0" )
3333 end ,
3434 },
3535})
3636
37- T [" text_actions" ][" insert_f_string" ] = function ()
38- child .type_keys (" i" , [[ print("{foo}")]] , " <left><esc>" )
37+ T [" f-string" ][" insert f string" ] = function ()
38+ child .cmd (" e! _not_existing_new_buffer.py" )
39+ child .type_keys (" cc" , [[ "{foo}"]] , " <Esc>" , " hh" , " i" , " <Esc>" )
40+ eq (get_lines (), { [[ f"{foo}"]] })
41+ end
42+
43+ T [" f-string" ][" skip on r" ] = function ()
44+ child .cmd (" e! _not_existing_new_buffer.py" )
45+ child .type_keys (" cc" , [[ r"{foo}"]] , " <Esc>" , " hh" , " i" , " <Esc>" )
46+ eq (get_lines (), { [[ r"{foo}"]] })
47+ end
3948
40- eq (get_lines (), { [[ print(f"{foo}")]] })
49+ T [" f-string" ][" skip on format" ] = function ()
50+ child .cmd (" e! _not_existing_new_buffer.py" )
51+ child .type_keys (" cc" , [[ "{foo}".format()]] , " <Esc>" , " 0lll" , " i" , " <Esc>" )
52+ eq (get_lines (), { [[ "{foo}".format()]] })
4153end
4254
4355-- Return test set which will be collected and execute inside `MiniTest.run()`
0 commit comments