ref: edbeb23f2c58b041b16367fde2b47bd73e0f3699
parent: bbfe54d2d3a3d49d9183eb93eb3fa2a522a0d0bf
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Mon Sep 18 15:31:19 EDT 2023
Add a manual test for SimpleReadline
--- /dev/null
+++ b/tests/Readline.hs
@@ -1,0 +1,16 @@
+module Readline(main) where
+import Prelude
+import System.Console.SimpleReadline
+
+main :: IO ()
+main = do
+ putStrLn "Type 'quit' to quit."
+ loop
+
+loop :: IO ()
+loop = do
+ s <- getInputLineHist "hist.txt" "% "
+ case s of
+ Just "quit" -> putStrLn "Bye"
+ _ -> do putStrLn $ showMaybe showString s; loop
+
--
⑨