setting history now works
[CleanReadLine.git] / test.icl
index 43f867d..7612e6a 100644 (file)
--- a/test.icl
+++ b/test.icl
@@ -3,7 +3,12 @@ module test
 import StdEnv
 import ReadLine
 
-Start :: *World -> (Int, String, HistoryState, *World)
+testHistory :: HistoryState
+testHistory = {HistoryState | 
+       entries=[{HistoryItem | line="custom", timestamp=""}],
+       offset=1, flags=0}
+
+Start :: *World -> (Int, String, HistoryState, HistoryState, *World)
 Start w
 # (f, w) = stdio w
 #! w = setReadLineName "Test program" w
@@ -14,6 +19,8 @@ Start w
 #! (s, w) = readLine "uparrow should word with history: " False w
 #! (_, w) = writeHistory "readline.history" w
 #! (i, w) = historySearch "testentry" -1 w
+#! (oh, w) = historyGetHistoryState w
+#! w = historySetHistoryState testHistory w
 #! (h, w) = historyGetHistoryState w
 #! w = clearHistory w
-= (i, s, h, w)
+= (i, s, oh, h, w)