give different strings for some tests
This commit is contained in:
@@ -647,9 +647,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test "does not break on undescore when cursor is on alphanumeric char"
|
||||||
"moves cursor past underscore \
|
|
||||||
\when underscore is between alphanumeric chars"
|
|
||||||
(fn _ =>
|
(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
|
||||||
@@ -672,10 +670,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (cursorChr = #"g")
|
Expect.isTrue (cursorChr = #"g")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test "breaks on punctuation when cursor is on alphanumeric char" (fn _ =>
|
||||||
"moves cursor to punctuation when next char\
|
|
||||||
\after continuous alphanumeric chars is punctuation"
|
|
||||||
(fn _ =>
|
|
||||||
(* vi's definition of 'word' instead of 'WORD' *)
|
(* vi's definition of 'word' instead of 'WORD' *)
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -691,10 +686,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (cursorChr = #",")
|
Expect.isTrue (cursorChr = #",")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test "breaks on alphanumeric char when cursor is on punctuation" (fn _ =>
|
||||||
"moves cursor to alphanumeric char when next char\
|
|
||||||
\after continuous punctuation chars is alphanumeric"
|
|
||||||
(fn _ =>
|
|
||||||
(* vi's definition of 'word' instead of 'WORD' *)
|
(* vi's definition of 'word' instead of 'WORD' *)
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -710,11 +702,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (cursorChr = #"h")
|
Expect.isTrue (cursorChr = #"h")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test "breaks on non-blank char when on blank char" (fn _ =>
|
||||||
"moves cursor to first {alphanumeric|punctuation} \
|
|
||||||
\when cursor is in {space|tab|'\\n'}"
|
|
||||||
(fn _ =>
|
|
||||||
(* vi's definition of 'word' instead of 'WORD' *)
|
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "0123 \t \n \t 789\n"
|
val buffer = LineGap.fromString "0123 \t \n \t 789\n"
|
||||||
@@ -730,7 +718,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (cursorChr = #"7")
|
Expect.isTrue (cursorChr = #"7")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to first alphanumeric char when in punctuation" (fn _ =>
|
, test "moves cursor to first alphanumeric char when on punctuation" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "!!! hello\n"
|
val buffer = LineGap.fromString "!!! hello\n"
|
||||||
@@ -746,7 +734,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
Expect.isTrue (startsAtExc andalso movedToH)
|
Expect.isTrue (startsAtExc andalso movedToH)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to last char in buffer when in last word" (fn _ =>
|
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "hello world\n"
|
val buffer = LineGap.fromString "hello world\n"
|
||||||
@@ -764,7 +752,7 @@ val wMove = describe "move motion 'w'"
|
|||||||
]
|
]
|
||||||
|
|
||||||
val WMove = describe "move motion 'W'"
|
val WMove = describe "move motion 'W'"
|
||||||
[ test "moves cursor to start of next word in contiguous string" (fn _ =>
|
[ test "moves cursor to start of next WORD in contiguous string" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "hello world"
|
val buffer = LineGap.fromString "hello world"
|
||||||
@@ -779,7 +767,7 @@ val WMove = describe "move motion 'W'"
|
|||||||
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 *)
|
||||||
val buffer = fromList ["hello ", "world"]
|
val buffer = fromList ["hello ", "world"]
|
||||||
@@ -794,7 +782,7 @@ val WMove = describe "move motion 'W'"
|
|||||||
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 *)
|
||||||
val buffer = LineGap.fromString "hello \n\n\n world"
|
val buffer = LineGap.fromString "hello \n\n\n world"
|
||||||
@@ -809,7 +797,8 @@ val WMove = describe "move motion 'W'"
|
|||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor past punctuation when in alphanumeric char" (fn _ =>
|
, test "does not break 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
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
@@ -825,11 +814,12 @@ val WMove = describe "move motion 'W'"
|
|||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor past alphanumeric char when in punctuation" (fn _ =>
|
, test "does not break 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
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "!hello!!! world!!!\n"
|
val buffer = LineGap.fromString "#!hello!!! world!!!\n"
|
||||||
val app = AppType.init (buffer, 0, 0)
|
val app = AppType.init (buffer, 0, 0)
|
||||||
|
|
||||||
(* act *)
|
(* act *)
|
||||||
@@ -841,10 +831,7 @@ val WMove = describe "move motion 'W'"
|
|||||||
Expect.isTrue (cursorChr = #"w")
|
Expect.isTrue (cursorChr = #"w")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test
|
, test "moves cursor to first non-blank when cursor is on blank" (fn _ =>
|
||||||
"moves cursor to first {alphanumeric|punctuation} \
|
|
||||||
\when cursor is in {space|tab|'\\n'}"
|
|
||||||
(fn _ =>
|
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "0123 \t \n \t 789\n"
|
val buffer = LineGap.fromString "0123 \t \n \t 789\n"
|
||||||
@@ -860,7 +847,7 @@ val WMove = describe "move motion 'W'"
|
|||||||
Expect.isTrue (cursorChr = #"7")
|
Expect.isTrue (cursorChr = #"7")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
, test "moves cursor to last char in buffer when in last word" (fn _ =>
|
, test "moves cursor to last char when cursor is on last word" (fn _ =>
|
||||||
let
|
let
|
||||||
(* arrange *)
|
(* arrange *)
|
||||||
val buffer = LineGap.fromString "hello world\n"
|
val buffer = LineGap.fromString "hello world\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user