summaryrefslogtreecommitdiff
path: root/test/ess-test-r.el
diff options
context:
space:
mode:
authorLionel Henry <lionel.hry@gmail.com>2020-07-20 12:53:56 +0200
committerLionel Henry <lionel.hry@gmail.com>2020-08-15 09:53:57 +0200
commit03365e9a9987906c1124c0db4305e8d726091fd6 (patch)
tree2c49135c15fc24401265bca62e7cc1ae9bee1689 /test/ess-test-r.el
parent136d6412fa08f9d708946f844f604d2c0b6ecb04 (diff)
Add "RET" motion test for transcript-mode
Closes #1013
Diffstat (limited to 'test/ess-test-r.el')
-rw-r--r--test/ess-test-r.el53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/ess-test-r.el b/test/ess-test-r.el
index 6eb557a..6a970af 100644
--- a/test/ess-test-r.el
+++ b/test/ess-test-r.el
@@ -17,6 +17,7 @@
;;
(require 'ert)
+(require 'ess-test-literate)
(require 'ess-r-mode)
(require 'ess-test-r-utils)
(require 'cc-mode)
@@ -711,6 +712,58 @@ Arguments:
(should (equal (ess-roxy-remove-roxy-re "#' 1\n#' 2\nNULL")
"#' 1\n#' 2\nNULL"))))
+(defun ess-r-test-transcript-init ()
+ (ess-r-transcript-mode)
+ (read-only-mode -1)
+ (setq ess-local-process-name ess-r-test-proc-name)
+ (setq etest-local-inferior-buffer ess-r-test-proc-buf))
+
+(etest-deftest ess-r-transcript-motions-test ()
+ "[enter] handles commands, non-commands, and prompts (#1013)."
+ :init ((eval . (ess-r-test-transcript-init)))
+ :case "
+¶R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+"
+ :test "RET"
+ :result "
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+¶"
+
+ :inf-result "
+> "
+
+ :messages "No command at this point"
+
+ :case "
+> ¶for(i in 1:3) {
++ print(i)
++ }
+[1] 1
+[1] 2
+[1] 3
+"
+ :test "RET"
+ :result "
+> for(i in 1:3) {
++ print(i)
++ }
+[1] 1
+[1] 2
+[1] 3
+¶"
+
+ :inf-result "for(i in 1:3) {
++ print(i)
++ }
+[1] 1
+[1] 2
+[1] 3
+> ")
+
(provide 'ess-test-r)
;;; ess-test-r.el ends here