done with delete-around-word ('daw') tests. Next: delete-around-WORD ('daW') tests.
This commit is contained in:
@@ -4581,6 +4581,46 @@ struct
|
||||
(actualString = expectedString
|
||||
andalso cursorIdx = expectedCursorIdx)
|
||||
end)
|
||||
, test
|
||||
"deletes alpha word when cursor is on alpha char \
|
||||
\and alpha word is surrounded by punctuation chars"
|
||||
(fn _ =>
|
||||
let
|
||||
(* arrange *)
|
||||
val app = TestUtils.init "#hello#\n"
|
||||
val app = AppWith.idx (app, 3)
|
||||
|
||||
(* act *)
|
||||
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "daw")
|
||||
|
||||
(* assert *)
|
||||
val expectedIdx = 1
|
||||
val expectedString = "##\n"
|
||||
val actualString = LineGap.toString buffer
|
||||
in
|
||||
Expect.isTrue
|
||||
(expectedString = actualString andalso expectedIdx = cursorIdx)
|
||||
end)
|
||||
, test
|
||||
"deletes punctuation word when cursor is on punctuation char \
|
||||
\and punctuation word is surrounded by alpha chars"
|
||||
(fn _ =>
|
||||
let
|
||||
(* arrange *)
|
||||
val app = TestUtils.init "h#%&(e\n"
|
||||
val app = AppWith.idx (app, 3)
|
||||
|
||||
(* act *)
|
||||
val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "daw")
|
||||
|
||||
(* assert *)
|
||||
val expectedIdx = 1
|
||||
val expectedString = "he\n"
|
||||
val actualString = LineGap.toString buffer
|
||||
in
|
||||
Expect.isTrue
|
||||
(expectedString = actualString andalso expectedIdx = cursorIdx)
|
||||
end)
|
||||
]
|
||||
|
||||
val tests =
|
||||
|
||||
2
todo.md
2
todo.md
@@ -1,7 +1,7 @@
|
||||
# To-do list
|
||||
|
||||
- Add tests for:
|
||||
- Test delete-around-word/WORD
|
||||
- Test delete-around-WORD
|
||||
- Delete-around-word has tests for when cursor is on space (needs tests for alpha and punctuation too)
|
||||
- Reimple `%` motion and `d%` motion.
|
||||
- They should both search for the next character in any pair, the same way in Vim
|
||||
|
||||
Reference in New Issue
Block a user