remove line breaks between tests in test/test.sml, because more code fits on screen that way, and the differing intentation is enough of a visual sign to mark when new test begins (aside from the 'test' keyword itself)
This commit is contained in:
@@ -90,7 +90,6 @@ val hMove = describe "move motion 'h'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 0)
|
Expect.isTrue (cursorIdx = 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor left by one in split string when cursorIdx > 0" (fn _ =>
|
, test "moves cursor left by one in split string when cursorIdx > 0" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -104,7 +103,6 @@ val hMove = describe "move motion 'h'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 4)
|
Expect.isTrue (cursorIdx = 4)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "does not move cursor when cursorIdx = 0" (fn _ =>
|
, test "does not move cursor when cursorIdx = 0" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -118,7 +116,6 @@ val hMove = describe "move motion 'h'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 0)
|
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor left by two in contiguous string when prev chr is \\n"
|
, test "moves cursor left by two in contiguous string when prev chr is \\n"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -133,7 +130,6 @@ val hMove = describe "move motion 'h'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 4)
|
Expect.isTrue (cursorIdx = 4)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor left by two in split string when prev chr is \\n"
|
, test "moves cursor left by two in split string when prev chr is \\n"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -166,7 +162,6 @@ val lMove = describe "move motion 'l'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 1)
|
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor right by one in split string when cursorIdx < length"
|
, test "moves cursor right by one in split string when cursorIdx < length"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -181,7 +176,6 @@ val lMove = describe "move motion 'l'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 1)
|
Expect.isTrue (oldCursorIdx = 0 andalso cursorIdx = 1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "does not move cursor when cursorIdx = length" (fn _ =>
|
, test "does not move cursor when cursorIdx = length" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -195,7 +189,6 @@ val lMove = describe "move motion 'l'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 10)
|
Expect.isTrue (cursorIdx = 10)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves right by two in contiguous string when char is followed by \\n"
|
, test "moves right by two in contiguous string when char is followed by \\n"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -210,7 +203,6 @@ val lMove = describe "move motion 'l'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 6)
|
Expect.isTrue (cursorIdx = 6)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves right by two in split string when char is followed by \\n"
|
, test "moves right by two in split string when char is followed by \\n"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -250,7 +242,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur down one column in split string when column = 0" (fn _ =>
|
, test "moves cursur down one column in split string when column = 0" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -269,7 +260,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur down one column in contiguous string when column = 1"
|
, test "moves cursur down one column in contiguous string when column = 1"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -290,7 +280,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur down one column in split string when column = 1" (fn _ =>
|
, test "moves cursur down one column in split string when column = 1" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -310,7 +299,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur down one column in contiguous string when column = 2"
|
, test "moves cursur down one column in contiguous string when column = 2"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -331,7 +319,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur down one column in split string when column = 2" (fn _ =>
|
, test "moves cursur down one column in split string when column = 2" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -351,7 +338,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "skips '\\n' when cursor is on non-\\n and is followed by two '\\n's"
|
, test "skips '\\n' when cursor is on non-\\n and is followed by two '\\n's"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -367,7 +353,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue isSkipped
|
Expect.isTrue isSkipped
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves to end of buffer when on last line" (fn _ =>
|
, test "moves to end of buffer when on last line" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -388,7 +373,6 @@ val jMove = describe "move motion 'j'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue isAtEnd
|
Expect.isTrue isAtEnd
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "leaves cursor at same idx when already at end of buffer" (fn _ =>
|
, test "leaves cursor at same idx when already at end of buffer" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -452,7 +436,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur up one column in contiguous string when column = 1"
|
, test "moves cursur up one column in contiguous string when column = 1"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -473,7 +456,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur up one column in split string when column = 1" (fn _ =>
|
, test "moves cursur up one column in split string when column = 1" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -493,7 +475,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur up one column in contiguous string when column = 2"
|
, test "moves cursur up one column in contiguous string when column = 2"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
let
|
let
|
||||||
@@ -514,7 +495,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursur up one column in split string when column = 2" (fn _ =>
|
, test "moves cursur up one column in split string when column = 2" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -534,7 +514,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (c1 andalso c2 andalso c3)
|
Expect.isTrue (c1 andalso c2 andalso c3)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test
|
||||||
"skips '\\n' when cursor is on '\\n',\
|
"skips '\\n' when cursor is on '\\n',\
|
||||||
\prev-char is '\\n' and prev-prev char is not '\\n'"
|
\prev-char is '\\n' and prev-prev char is not '\\n'"
|
||||||
@@ -554,7 +533,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue isSkipped
|
Expect.isTrue isSkipped
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves to 0 of buffer when on first line" (fn _ =>
|
, test "moves to 0 of buffer when on first line" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -571,7 +549,6 @@ val kMove = describe "move motion 'k'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue isAtStart
|
Expect.isTrue isAtStart
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "leaves cursor at same idx when already at start of buffer" (fn _ =>
|
, test "leaves cursor at same idx when already at start of buffer" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -610,7 +587,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (chr = #"w")
|
Expect.isTrue (chr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to start of next word in split string" (fn _ =>
|
, test "moves cursor to start of next word in split string" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -625,7 +601,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (chr = #"w")
|
Expect.isTrue (chr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor past newline when next word is after newline" (fn _ =>
|
, test "moves cursor past newline when next word is after newline" (fn _ =>
|
||||||
(* This behaviour makes behaviour different from vi,
|
(* This behaviour makes behaviour different from vi,
|
||||||
* where "w" when a newline is in between causes cursor
|
* where "w" when a newline is in between causes cursor
|
||||||
@@ -647,7 +622,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "does not break on undescore when cursor is on alphanumeric char"
|
, test "does not break on undescore when cursor is on alphanumeric char"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
(* This behaviour makes behaviour different from vi,
|
(* This behaviour makes behaviour different from vi,
|
||||||
@@ -670,7 +644,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"g")
|
Expect.isTrue (cursorChr = #"g")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "breaks on punctuation when cursor is on alphanumeric char" (fn _ =>
|
, test "breaks on punctuation when cursor is on alphanumeric char" (fn _ =>
|
||||||
(* vi's definition of 'word' instead of 'WORD' *)
|
(* vi's definition of 'word' instead of 'WORD' *)
|
||||||
let
|
let
|
||||||
@@ -686,7 +659,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #",")
|
Expect.isTrue (cursorChr = #",")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "breaks on alphanumeric char when cursor is on punctuation" (fn _ =>
|
, test "breaks on alphanumeric char when cursor is on punctuation" (fn _ =>
|
||||||
(* vi's definition of 'word' instead of 'WORD' *)
|
(* vi's definition of 'word' instead of 'WORD' *)
|
||||||
let
|
let
|
||||||
@@ -702,7 +674,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"h")
|
Expect.isTrue (cursorChr = #"h")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "breaks on non-blank char when on blank char" (fn _ =>
|
, test "breaks on non-blank char when on blank char" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -718,7 +689,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"7")
|
Expect.isTrue (cursorChr = #"7")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to first alphanumeric char when on punctuation" (fn _ =>
|
, test "moves cursor to first alphanumeric char when on punctuation" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -734,7 +704,6 @@ val wMove = describe "move motion 'w'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (startsAtExc andalso movedToH)
|
Expect.isTrue (startsAtExc andalso movedToH)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -767,7 +736,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (chr = #"w")
|
Expect.isTrue (chr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to start of next WORD in split string" (fn _ =>
|
, test "moves cursor to start of next WORD in split string" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -782,7 +750,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (chr = #"w")
|
Expect.isTrue (chr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor past newline when next WORD is after newline" (fn _ =>
|
, test "moves cursor past newline when next WORD is after newline" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -797,7 +764,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "does not break on punctuation when cursor is on alphanumeric char"
|
, test "does not break on punctuation when cursor is on alphanumeric char"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
(* vi's definition of 'WORD' instead of 'word' *)
|
(* vi's definition of 'WORD' instead of 'word' *)
|
||||||
@@ -814,7 +780,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "does not break on alphanumeric char when cursor is on punctuation"
|
, test "does not break on alphanumeric char when cursor is on punctuation"
|
||||||
(fn _ =>
|
(fn _ =>
|
||||||
(* vi's definition of 'WORD' instead of 'word' *)
|
(* vi's definition of 'WORD' instead of 'word' *)
|
||||||
@@ -831,7 +796,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to first non-blank when cursor is on blank" (fn _ =>
|
, test "moves cursor to first non-blank when cursor is on blank" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -847,7 +811,6 @@ val WMove = describe "move motion 'W'"
|
|||||||
in
|
in
|
||||||
Expect.isTrue (cursorChr = #"7")
|
Expect.isTrue (cursorChr = #"7")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -879,7 +842,6 @@ val zeroMove = describe "move motion '0'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 0)
|
Expect.isTrue (cursorIdx = 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to 0 in split string when on first line" (fn _ =>
|
, test "moves cursor to 0 in split string when on first line" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -893,7 +855,6 @@ val zeroMove = describe "move motion '0'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 0)
|
Expect.isTrue (cursorIdx = 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "leaves cursor on 0 when cursor is already on 0" (fn _ =>
|
, test "leaves cursor on 0 when cursor is already on 0" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -906,7 +867,6 @@ val zeroMove = describe "move motion '0'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (cursorIdx = 0)
|
Expect.isTrue (cursorIdx = 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "leaves cursor at same idx when cursor is on '\\n'" (fn _ =>
|
, test "leaves cursor at same idx when cursor is on '\\n'" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -923,7 +883,6 @@ val zeroMove = describe "move motion '0'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (oldIdx = newIdx)
|
Expect.isTrue (oldIdx = newIdx)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test
|
||||||
"moves cursor to first char after '\\n' in contiguous string\
|
"moves cursor to first char after '\\n' in contiguous string\
|
||||||
\when cursor is after first line"
|
\when cursor is after first line"
|
||||||
@@ -943,7 +902,6 @@ val zeroMove = describe "move motion '0'"
|
|||||||
(* assert *)
|
(* assert *)
|
||||||
Expect.isTrue (chr = #"#")
|
Expect.isTrue (chr = #"#")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test
|
||||||
"moves cursor to first char after '\\n' in split string\
|
"moves cursor to first char after '\\n' in split string\
|
||||||
\when cursor is after first line"
|
\when cursor is after first line"
|
||||||
|
|||||||
Reference in New Issue
Block a user