Merge pull request #3 from dopefishh/standard-maybe
[CleanReadLine.git] / test.icl
index 26ced3c..5ed1daa 100644 (file)
--- a/test.icl
+++ b/test.icl
@@ -3,11 +3,45 @@ module test
 import StdEnv
 import ReadLine
 
-Start :: *World -> (String, *World)
+testHistory :: HistoryState
+testHistory = {HistoryState | 
+       entries=[{HistoryItem | line="custom", timestamp=""}],
+       offset=1, flags=0}
+
+Start :: *World -> (String, [String], *World)
 Start w
-# (f, w) = stdio w
+#! w = setReadLineName "Test program" w
+#! w = usingHistory w
 #! (_, w) = readHistory "readline.history" w
+#! w = addHistory "testentry1" w
+#! w = addHistoryTime "time1" w
+#! w = addHistory "testentry2" w
+#! w = addHistoryTime "time2" w
+#! (hi, w) = removeHistory 1 w
+#! (hy, w) = replaceHistoryEntry 1 "replacement" w
 #! (s, w) = readLine "first prompt: " True w
 #! (s, w) = readLine "uparrow should word with history: " False w
 #! (_, w) = writeHistory "readline.history" w
-= (s, w)
+#! (i, w) = historySearch "testentry" -1 w
+#! (_, w) = historyList w
+#! (_, w) = whereHistory w
+#! (_, w) = currentHistory w
+#! (_, w) = historyGet 1 w
+#! (_, w) = historyTotalBytes w
+#! w = stifleHistory 2 w
+#! (i, w) = historyIsStifled w
+#! w = unstifleHistory w
+#! (i, w) = historyIsStifled w
+#! (i, w) = historySetPos 1 w
+#! (h, w) = previousHistory w
+#! (h, w) = nextHistory w
+#! (s, i, w) = historyExpand "hoi" w
+#! (s, i, w) = getHistoryEvent "hoi" 1 0 w
+#! (s, w) = historyArgExtract 1 2 "hoi1 hoi2 hoi3" w
+#! (s, w) = historyArgExtract 98 99 "hoi1 hoi2 hoi3" w
+#! (ss, w) = historyTokenize "hoi1 hoi2 hoi3" w
+#! (oh, w) = historyGetHistoryState w
+#! w = historySetHistoryState testHistory w
+#! (h, w) = historyGetHistoryState w
+#! w = clearHistory w
+= (toString h, ss, w)