diff --git a/test/normal-delete.sml b/test/normal-delete.sml index ec9300a..1288af9 100644 --- a/test/normal-delete.sml +++ b/test/normal-delete.sml @@ -944,6 +944,30 @@ struct in Expect.isTrue (stringsAreExpected andalso cursorsAreExpected) end) + , test + "deletes newline when there is a newline after current word \ + \and there is another word following that newline" + (fn _ => + let + (* arrange *) + val originalString = "hello\nworld\nagain\n" + val app = TestUtils.init originalString + val app = AppWith.idx (app, 1) + + (* act *) + val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dw") + + (* assert *) + val expectedString = "hworld\nagain\n" + val expectedCursor = 1 + + val actualString = LineGap.toString buffer + + val stringIsExpected = expectedString = actualString + val cursorIsExpected = expectedCursor = cursorIdx + in + Expect.isTrue (stringIsExpected andalso cursorIsExpected) + end) ] val tests = [dhDelete, dlDelete, djDelete, ddDelete, dkDelete, dwDelete]