diff --git a/temp.txt b/temp.txt index 3b18e51..0056b4a 100644 --- a/temp.txt +++ b/temp.txt @@ -1 +1,3 @@ -hello world +hello +world +again diff --git a/test/normal-delete.sml b/test/normal-delete.sml index b5699ab..83a04bd 100644 --- a/test/normal-delete.sml +++ b/test/normal-delete.sml @@ -2394,6 +2394,27 @@ struct (actualString = expectedString andalso cursorIdx = expectedCursorIdx) end) + , test "deletes past newline when on first word after newline" (fn _ => + let + (* arrange *) + val originalString = "hello\nworld\nagain\n" + val app = TestUtils.init originalString + val app = AppWith.idx (app, 6) + + (* act *) + val {buffer, cursorIdx, ...} = TestUtils.updateMany (app, "dge") + + (* assert *) + val expectedString = "hellorld\nagain\n" + val expectedCursor = 4 + + val actualString = LineGap.toString buffer + + val stringIsExpected = expectedString = actualString + val cursorIsExpected = expectedCursor = cursorIdx + in + Expect.isTrue (stringIsExpected andalso cursorIsExpected) + end) ] val tests =