emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ess 3e005140d2 04/12: Port ELT syntax tests to etest


From: ELPA Syncer
Subject: [elpa] externals/ess 3e005140d2 04/12: Port ELT syntax tests to etest
Date: Sun, 16 Apr 2023 08:57:43 -0400 (EDT)

branch: externals/ess
commit 3e005140d2c475c45ba07acaa49b6e3f1378c148
Author: Lionel Henry <lionel.hry@gmail.com>
Commit: Lionel Henry <lionel.hry@gmail.com>

    Port ELT syntax tests to etest
---
 test/ess-test-r-syntax.el | 138 +++++++++++++++++++++++++++++++++
 test/literate/syntax.R    | 193 ----------------------------------------------
 test/run-tests            |   1 -
 3 files changed, 138 insertions(+), 194 deletions(-)

diff --git a/test/ess-test-r-syntax.el b/test/ess-test-r-syntax.el
index 4184eefca0..9d745d65e4 100644
--- a/test/ess-test-r-syntax.el
+++ b/test/ess-test-r-syntax.el
@@ -91,6 +91,144 @@ r\"(foor¶'()¶'bar))\"
   (should (not (equal (syntax-after (point))
                       (string-to-syntax "|")))))
 
+(etest-deftest ess-r-syntax-climb-test ()
+  :case "
+stuff1 =, ¶stuff2
+stuff1 =; ¶stuff2
+stuff1 := ¶stuff2
+stuff1 %a?a:a% ¶stuff2
+stuff1 %% ¶stuff2
+stuff1 => ¶stuff2
+"
+  (ess-climb-operator)
+  :result "
+stuff1 =, ¶stuff2
+stuff1 =; ¶stuff2
+stuff1¶ := stuff2
+stuff1¶ %a?a:a% stuff2
+stuff1¶ %% stuff2
+stuff1¶ => stuff2
+"
+
+  :case "
+function_call()
+¶
+"
+  (ess-climb-block-prefix)
+  :result "
+function_call()
+¶
+"
+  (ess-climb-block-prefix "function")
+  :result "
+function_call()
+¶
+")
+
+(etest-deftest ess-r-syntax-climb-continuations-test ()
+  :case "(!stuff1 ||¶ stuff2)"
+  (ess-climb-continuations)
+  :result "(¶!stuff1 || stuff2)"
+
+  :case "
+object <-
+    fun_call() %>%
+    ¶fun_call()
+
+object <-
+    fun_call() %>% fun_call() %>%
+    ¶fun_call()
+
+object <-
+    namespace::fun_call() %>%
+    ¶fun_call()
+
+object <-
+    namespace:::fun_call() %>%
+    ¶fun_call()
+
+object <-
+    object@fun_call() %>%
+    ¶fun_call()
+
+object <-
+    object$fun_call() %>%
+    ¶fun_call()
+"
+
+  (ess-climb-continuations)
+  :result "
+¶object <-
+    fun_call() %>%
+    fun_call()
+
+¶object <-
+    fun_call() %>% fun_call() %>%
+    fun_call()
+
+¶object <-
+    namespace::fun_call() %>%
+    fun_call()
+
+¶object <-
+    namespace:::fun_call() %>%
+    fun_call()
+
+¶object <-
+    object@fun_call() %>%
+    fun_call()
+
+¶object <-
+    object$fun_call() %>%
+    fun_call()
+")
+
+(etest-deftest ess-r-syntax-climb-sticky-ops-test ()
+  :case "
+object@field¶
+object$field¶
+namespace::object¶
+namespace:::object¶
+"
+
+  (ess-climb-expression)
+  :result "
+¶object@field
+¶object$field
+¶namespace::object
+¶namespace:::object
+"
+
+  ;; reset-case
+  :case "
+object@field¶
+object$field¶
+namespace::object¶
+namespace:::object¶
+"
+
+  (ess-climb-object)
+  :result "
+¶object@field
+¶object$field
+¶namespace::object
+¶namespace:::object
+")
+
+(etest-deftest ess-r-syntax-jump-test ()
+  :case "
+    ¶if (test1)
+        stuff1
+    if (test2)
+        stuff2"
+
+  (ess-jump-expression)
+  :result "
+    if (test1)
+        stuff1¶
+    if (test2)
+        stuff2")
+
 
 ;; Local Variables:
 ;; etest-local-config: etest-r-config
diff --git a/test/literate/syntax.R b/test/literate/syntax.R
deleted file mode 100644
index b385d74def..0000000000
--- a/test/literate/syntax.R
+++ /dev/null
@@ -1,193 +0,0 @@
-
-##### Statements
-
-### 1 ----------------------------------------------------------------
-
-(!stuff1 ||¶ stuff2)
-
-##! (ess-climb-continuations)
-
-(¶!stuff1 || stuff2)
-
-
-
-##### Operators
-
-### 1a ---------------------------------------------------------------
-
-stuff1 =, ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1 =, ¶stuff2
-
-
-### 1b ---------------------------------------------------------------
-
-stuff1 =; ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1 =; ¶stuff2
-
-
-### 1c ---------------------------------------------------------------
-
-stuff1 := ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1¶ := stuff2
-
-
-### 1d ---------------------------------------------------------------
-
-stuff1 %a?a:a% ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1¶ %a?a:a% stuff2
-
-
-### 1e ---------------------------------------------------------------
-
-stuff1 %% ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1¶ %% stuff2
-
-
-### 1f ---------------------------------------------------------------
-
-stuff1 => ¶stuff2
-
-##! (ess-climb-operator)
-
-stuff1¶ => stuff2
-
-
-
-##### Bare blocks
-
-### 1 ----------------------------------------------------------------
-
-function_call()
-¶
-
-##! (ess-climb-block-prefix)
-
-function_call()
-¶
-
-##! (ess-climb-block-prefix "function")
-
-function_call()
-¶
-
-
-### 2 ----------------------------------------------------------------
-
-    ¶if (test1)
-        stuff1
-    if (test2)
-        stuff2
-
-##! (ess-jump-expression)
-
-    if (test1)
-        stuff1¶
-    if (test2)
-        stuff2
-
-
-
-##### Continuations
-
-### 1a ---------------------------------------------------------------
-
-object <-
-    fun_call() %>%
-    ¶fun_call()
-
-##! (ess-climb-continuations)
-
-¶object <-
-    fun_call() %>%
-    fun_call()
-
-
-### 1b ---------------------------------------------------------------
-
-object <-
-    fun_call() %>% fun_call() %>%
-    ¶fun_call()
-
-##! (ess-climb-continuations)
-
-¶object <-
-    fun_call() %>% fun_call() %>%
-    fun_call()
-
-
-### 1c ---------------------------------------------------------------
-
-object <-
-    namespace::fun_call() %>%
-    ¶fun_call()
-
-object <-
-    namespace:::fun_call() %>%
-    ¶fun_call()
-
-object <-
-    object@fun_call() %>%
-    ¶fun_call()
-
-object <-
-    object$fun_call() %>%
-    ¶fun_call()
-
-##! (ess-climb-continuations)
-
-¶object <-
-    namespace::fun_call() %>%
-    fun_call()
-
-¶object <-
-    namespace:::fun_call() %>%
-    fun_call()
-
-¶object <-
-    object@fun_call() %>%
-    fun_call()
-
-¶object <-
-    object$fun_call() %>%
-    fun_call()
-
-
-
-##### Expressions
-
-### 1 Sticky operators -----------------------------------------------
-
-object@field¶
-object$field¶
-namespace::object¶
-namespace:::object¶
-
-##! (ess-climb-expression)
-
-¶object@field
-¶object$field
-¶namespace::object
-¶namespace:::object
-
-##! (ess-climb-object)
-
-¶object@field
-¶object$field
-¶namespace::object
-¶namespace:::object
-
diff --git a/test/run-tests b/test/run-tests
index 3dafc3bfdd..45115b6a78 100755
--- a/test/run-tests
+++ b/test/run-tests
@@ -56,7 +56,6 @@
   (ess-test-load-locally "ess-test-literate.el" ess-test-path)
   (ess-test-load-locally "test-etest.el" etest-path)
   ;; (elt-deftest test-ess-r-code-fill () "code-fill.R")
-  (elt-deftest test-ess-r-syntax () "syntax.R")
   (elt-deftest test-ess-r-tokens () "tokens.R")
   (elt-deftest test-ess-r-fontification () "fontification.R")
   (elt-deftest test-ess-r-keybindings () "keybindings.R"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]