done refactoring tests
This commit is contained in:
@@ -137,6 +137,7 @@ struct
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
(* this function exists only for testing *)
|
||||||
fun idx (app, newIdx) =
|
fun idx (app, newIdx) =
|
||||||
let
|
let
|
||||||
val
|
val
|
||||||
|
|||||||
@@ -38,3 +38,14 @@ fcore/normal-mode/normal-delete.sml
|
|||||||
fcore/normal-mode/normal-mode.sml
|
fcore/normal-mode/normal-mode.sml
|
||||||
|
|
||||||
fcore/app-update.sml
|
fcore/app-update.sml
|
||||||
|
|
||||||
|
(* TEST FILES *)
|
||||||
|
$(SML_LIB)/basis/mlton.mlb
|
||||||
|
shell/exception-logger.sml
|
||||||
|
test/Railroad/src/railroad.mlb
|
||||||
|
|
||||||
|
test/test-utils.sml
|
||||||
|
test/normal-move.sml
|
||||||
|
test/normal-delete.sml
|
||||||
|
test/regression.sml
|
||||||
|
test/test.sml
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@ struct
|
|||||||
let
|
let
|
||||||
val chr = String.sub (str, pos)
|
val chr = String.sub (str, pos)
|
||||||
val () = ExceptionLogger.addCommand (InputMsg.CHAR_EVENT chr)
|
val () = ExceptionLogger.addCommand (InputMsg.CHAR_EVENT chr)
|
||||||
val app = AppUpdate.update (app, InputMsg.CHAR_EVENT chr)
|
val app = TestUtils.update (app, InputMsg.CHAR_EVENT chr)
|
||||||
in
|
in
|
||||||
updateLoop (pos + 1, str, app)
|
updateLoop (pos + 1, str, app)
|
||||||
end
|
end
|
||||||
@@ -19,7 +19,7 @@ struct
|
|||||||
|
|
||||||
fun appFromText text =
|
fun appFromText text =
|
||||||
let val buffer = LineGap.fromString text
|
let val buffer = LineGap.fromString text
|
||||||
in AppType.init (buffer, 0, 0)
|
in TestUtils.init buffer
|
||||||
end
|
end
|
||||||
|
|
||||||
fun loadFromFile (io, acc) =
|
fun loadFromFile (io, acc) =
|
||||||
@@ -39,7 +39,7 @@ struct
|
|||||||
val initialApp = appFromText initialText
|
val initialApp = appFromText initialText
|
||||||
|
|
||||||
val charEventTests = describe "CHAR_EVENT regressions"
|
val charEventTests = describe "CHAR_EVENT regressions"
|
||||||
[test "SearchList.goToNum vector bounds regression (1)" (fn _ =>
|
[ test "SearchList.goToNum vector bounds regression (1)" (fn _ =>
|
||||||
let
|
let
|
||||||
val app = appFromText initialText
|
val app = appFromText initialText
|
||||||
val history = "G12dk"
|
val history = "G12dk"
|
||||||
@@ -47,17 +47,17 @@ struct
|
|||||||
in
|
in
|
||||||
(* just expect that we do not fail or throw an exception *)
|
(* just expect that we do not fail or throw an exception *)
|
||||||
Expect.isTrue true
|
Expect.isTrue true
|
||||||
end),
|
end)
|
||||||
|
,
|
||||||
test "idk yet" (fn _ =>
|
test "idk yet" (fn _ =>
|
||||||
let
|
let
|
||||||
val app = appFromText initialText
|
val app = appFromText initialText
|
||||||
val history = "16G18ddjjjjjjjjjdkdkdkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"
|
val history =
|
||||||
|
"16G18ddjjjjjjjjjdkdkdkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"
|
||||||
val newApp = applyChars (history, app)
|
val newApp = applyChars (history, app)
|
||||||
in
|
in
|
||||||
Expect.isTrue true
|
Expect.isTrue true
|
||||||
end
|
end)
|
||||||
)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
val tests = [charEventTests]
|
val tests = [charEventTests]
|
||||||
|
|||||||
8
test/test-utils.sml
Normal file
8
test/test-utils.sml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
structure TestUtils =
|
||||||
|
struct
|
||||||
|
fun init buffer =
|
||||||
|
AppType.init (buffer, 0, 0, Time.now ())
|
||||||
|
|
||||||
|
fun update (app, cmd) =
|
||||||
|
AppUpdate.update (app, cmd, Time.now ())
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user