From 78d7e59f71646af0871ce40368193745431caf1c Mon Sep 17 00:00:00 2001 From: Bruno BARBIER Date: Sat, 29 Apr 2023 10:27:57 +0200 Subject: [PATCH 10/13] * testing/lisp/test-ob-haskell-ghci.el: Test output without EOL (ob-haskell/output-without-eol-1): (ob-haskell/output-without-eol-2): (ob-haskell/output-without-eol-3): New tests. --- testing/lisp/test-ob-haskell-ghci.el | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el index b452a55dd..49d5a8684 100644 --- a/testing/lisp/test-ob-haskell-ghci.el +++ b/testing/lisp/test-ob-haskell-ghci.el @@ -165,6 +165,38 @@ (ert-deftest ob-haskell/eval-strings () "Evaluation of strings." (should (equal "a string" (test-ob-haskell-ghci "" "\"a string\"")))) +;;;; Output without EOL +;; + +(ert-deftest ob-haskell/output-without-eol-1 () + "Cannot get output from incomplete lines, when entered line by line." + :expected-result :failed + (should (equal "123" + (test-ob-haskell-ghci ":results output" " + putStr(\"1\") + putStr(\"2\") + putStr(\"3\") + putStr(\"\\n\") +")))) + +(ert-deftest ob-haskell/output-without-eol-2 () + "Incomplete output lines are OK when using a multiline block." + (should (equal "123" + (test-ob-haskell-ghci ":results output" " +:{ + do putStr(\"1\") + putStr(\"2\") + putStr(\"3\") + putStr(\"\\n\") +:} +")))) + +(ert-deftest ob-haskell/output-without-eol-3 () + "Incomplete output lines are OK on one line." + (should (equal "123" + (test-ob-haskell-ghci ":results output" " +do { putStr(\"1\"); putStr(\"2\"); putStr(\"3\"); putStr(\"\\n\") } +")))) ;;;; Local variables (ert-deftest ob-haskell/let-one-line () -- 2.39.3