Merge pull request #3 from dopefishh/standard-maybe
[CleanReadLine.git] / test.icl
1 module test
2
3 import StdEnv
4 import ReadLine
5
6 testHistory :: HistoryState
7 testHistory = {HistoryState |
8 entries=[{HistoryItem | line="custom", timestamp=""}],
9 offset=1, flags=0}
10
11 Start :: *World -> (String, [String], *World)
12 Start w
13 #! w = setReadLineName "Test program" w
14 #! w = usingHistory w
15 #! (_, w) = readHistory "readline.history" w
16 #! w = addHistory "testentry1" w
17 #! w = addHistoryTime "time1" w
18 #! w = addHistory "testentry2" w
19 #! w = addHistoryTime "time2" w
20 #! (hi, w) = removeHistory 1 w
21 #! (hy, w) = replaceHistoryEntry 1 "replacement" w
22 #! (s, w) = readLine "first prompt: " True w
23 #! (s, w) = readLine "uparrow should word with history: " False w
24 #! (_, w) = writeHistory "readline.history" w
25 #! (i, w) = historySearch "testentry" -1 w
26 #! (_, w) = historyList w
27 #! (_, w) = whereHistory w
28 #! (_, w) = currentHistory w
29 #! (_, w) = historyGet 1 w
30 #! (_, w) = historyTotalBytes w
31 #! w = stifleHistory 2 w
32 #! (i, w) = historyIsStifled w
33 #! w = unstifleHistory w
34 #! (i, w) = historyIsStifled w
35 #! (i, w) = historySetPos 1 w
36 #! (h, w) = previousHistory w
37 #! (h, w) = nextHistory w
38 #! (s, i, w) = historyExpand "hoi" w
39 #! (s, i, w) = getHistoryEvent "hoi" 1 0 w
40 #! (s, w) = historyArgExtract 1 2 "hoi1 hoi2 hoi3" w
41 #! (s, w) = historyArgExtract 98 99 "hoi1 hoi2 hoi3" w
42 #! (ss, w) = historyTokenize "hoi1 hoi2 hoi3" w
43 #! (oh, w) = historyGetHistoryState w
44 #! w = historySetHistoryState testHistory w
45 #! (h, w) = historyGetHistoryState w
46 #! w = clearHistory w
47 = (toString h, ss, w)