[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ess 342eee64d3 02/12: Port ELT roxy-mode tests to etest
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ess 342eee64d3 02/12: Port ELT roxy-mode tests to etest |
Date: |
Sun, 16 Apr 2023 08:57:43 -0400 (EDT) |
branch: externals/ess
commit 342eee64d36aab3667f0183aa4a14a8fa521a1af
Author: Lionel Henry <lionel.hry@gmail.com>
Commit: Lionel Henry <lionel.hry@gmail.com>
Port ELT roxy-mode tests to etest
---
test/ess-test-r-utils.el | 1 +
test/ess-test-roxy.el | 115 ++++++++++++++++++++++++++++++++++++
test/literate/roxy.R | 149 -----------------------------------------------
test/literate/roxy.el | 7 ---
test/run-tests | 2 +-
5 files changed, 117 insertions(+), 157 deletions(-)
diff --git a/test/ess-test-r-utils.el b/test/ess-test-r-utils.el
index a896f18a84..c77ee48663 100644
--- a/test/ess-test-r-utils.el
+++ b/test/ess-test-r-utils.el
@@ -25,6 +25,7 @@
(defvar etest-r-config
'(:init ((mode . r)
+ (ess-offset . 4)
(eval . (ess-test-r-set-local-process)))))
(defvar ess-test-fixtures-directory
diff --git a/test/ess-test-roxy.el b/test/ess-test-roxy.el
new file mode 100644
index 0000000000..1608913108
--- /dev/null
+++ b/test/ess-test-roxy.el
@@ -0,0 +1,115 @@
+;;; ess-test-roxy.el --- ESS tests for Roxygen -*- lexical-binding: t; -*-
+;;
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; A copy of the GNU General Public License is available at
+;; https://www.r-project.org/Licenses/
+;;
+;;; Commentary:
+;;
+
+(require 'ert)
+(require 'etest "etest/etest")
+(require 'ess-r-mode)
+
+(defun ess-test--faces-at-point ()
+ (let ((face (get-char-property (point) 'face)))
+ (if (listp face)
+ face
+ (list face))))
+
+(etest-deftest ess-roxy-fill-paragraph-test ()
+ :case "
+##' Title
+##'
+##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
+¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
+"
+
+ "M-q" :result "
+##' Title
+##'
+##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+##' sed do eiusmod tempor incididunt ut labore et dolore magna
+##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
+##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
+¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit,
+##' sed do eiusmod tempor incididunt ut labore et dolore magna
+##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
+##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
+")
+
+(etest-deftest ess-roxy-ret-test ()
+ :case "
+##' ¶
+"
+
+ "RET"
+ :result "
+##'
+##' ¶
+"
+ "RET"
+ :result "
+##'
+##'
+##' ¶
+"
+
+ (setq-local ess-roxy-insert-prefix-on-newline nil)
+ "RET"
+ :result "
+##'
+##'
+##'
+¶
+"
+
+ :case "
+##' ¶
+"
+ "M-j"
+ :result "
+##'
+##' ¶
+")
+
+(etest-deftest ess-roxy-faces-param-test ()
+ :case "
+##' ¶@param foo
+##' @¶param foo
+"
+ (should (memq 'font-lock-keyword-face (ess-test--faces-at-point)))
+
+ :case "
+##' @param ¶foo
+"
+ (should (not (memq 'font-lock-keyword-face (ess-test--faces-at-point))))
+ (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
+
+ ;; Comma-separated params
+ :case "
+##' @param ¶foo,bar baz
+##' @param foo¶,bar baz
+##' @param foo,¶bar baz
+NULL
+"
+ (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
+
+ :case "
+##' @param foo,bar ¶baz
+NULL
+"
+ (should (not (memq 'font-lock-variable-name-face
(ess-test--faces-at-point)))))
+
+;; Local Variables:
+;; etest-local-config: etest-r-config
+;; End:
diff --git a/test/literate/roxy.R b/test/literate/roxy.R
deleted file mode 100644
index 27679cd789..0000000000
--- a/test/literate/roxy.R
+++ /dev/null
@@ -1,149 +0,0 @@
-
-##### Filling
-
-### 1a ---------------------------------------------------------------
-
-##' Title
-##'
-##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
-##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
-NULL
-
-##> (ess-roxy-mode)
-##! (fill-paragraph)
-
-##' Title
-##'
-##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-##' sed do eiusmod tempor incididunt ut labore et dolore magna
-##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
-##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
-##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-##' sed do eiusmod tempor incididunt ut labore et dolore magna
-##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
-##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
-NULL
-
-
-### 1b ---------------------------------------------------------------
-
-##' Title
-##'
-¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
-##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
-NULL
-
-##! (fill-paragraph)
-
-##' Title
-##'
-¶##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-##' sed do eiusmod tempor incididunt ut labore et dolore magna
-##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
-##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
-##' @param Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-##' sed do eiusmod tempor incididunt ut labore et dolore magna
-##' aliqua. Ut enim ad minim veniam, quis nostrud exercitation
-##' ullamco laboris nisi ut aliquip ex ea commodo consequat.
-NULL
-
-
-### 2 ----------------------------------------------------------------
-
-##' ¶
-
-##! "RET"
-
-##'
-##' ¶
-
-##> "RET"
-
-##'
-##'
-##' ¶
-
-##> (setq ess-roxy-insert-prefix-on-newline nil)
-##> "RET"
-
-##'
-##'
-##'
-¶
-
-##! "M-j"
-
-##'
-##' ¶
-
-
-### 3 ----------------------------------------------------------------
-
-##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor `incididunt' ut labore et ``dolore'' magna aliqua.
-NULL
-
-##! (fill-paragraph)
-
-##' @param¶ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-##' sed do eiusmod tempor `incididunt' ut labore et ``dolore''
-##' magna aliqua.
-NULL
-
-
-
-##### Fontification of roxy blocks
-
-### 1 Param keyword --------------------------------------------------
-
-##' ¶@param foo
-NULL
-
-##! (should (memq 'font-lock-keyword-face (ess-test--faces-at-point)))
-
-##' ¶@param foo
-NULL
-
-##> (forward-char)
-##> (should (memq 'font-lock-keyword-face (ess-test--faces-at-point)))
-
-##' @¶param foo
-NULL
-
-##> (forward-word)
-##> (forward-char)
-##> (should (not (memq 'font-lock-keyword-face (ess-test--faces-at-point))))
-##> (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
-
-##' @param ¶foo
-NULL
-
-
-### 2 Comma-separated params -----------------------------------------
-
-##' @param ¶foo,bar baz
-NULL
-
-##! (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
-
-##' @param ¶foo,bar baz
-NULL
-
-##> (forward-word)
-##> (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
-
-##' @param foo¶,bar baz
-NULL
-
-##> (forward-char)
-##> (should (memq 'font-lock-variable-name-face (ess-test--faces-at-point)))
-
-##' @param foo,¶bar baz
-NULL
-
-##> (forward-word)
-##> (forward-char)
-##> (should (not (memq 'font-lock-variable-name-face
(ess-test--faces-at-point))))
-
-##' @param foo,bar ¶baz
-NULL
-
diff --git a/test/literate/roxy.el b/test/literate/roxy.el
deleted file mode 100644
index 5c660e11f7..0000000000
--- a/test/literate/roxy.el
+++ /dev/null
@@ -1,7 +0,0 @@
-;; -*- lexical-binding: t; -*-
-
-(defun ess-test--faces-at-point ()
- (let ((face (get-char-property (point) 'face)))
- (if (listp face)
- face
- (list face))))
diff --git a/test/run-tests b/test/run-tests
index a427c99228..09b5c20b67 100755
--- a/test/run-tests
+++ b/test/run-tests
@@ -46,6 +46,7 @@
(ess-test-load-locally "ess-test-r-package.el" ess-test-path)
(ess-test-load-locally "ess-test-r-syntax.el" ess-test-path)
(ess-test-load-locally "ess-test-r.el" ess-test-path)
+ (ess-test-load-locally "ess-test-roxy.el" ess-test-path)
(ess-test-load-locally "ess-test-rd.el" ess-test-path))
(when (member "--r-indent" argv)
(ess-test-load-locally "ess-test-indentation.el" ess-test-path))
@@ -54,7 +55,6 @@
(when (member "--literate" argv)
(ess-test-load-locally "ess-test-literate.el" ess-test-path)
(ess-test-load-locally "test-etest.el" etest-path)
- (elt-deftest test-ess-roxy-literate () "roxy.R")
;; (elt-deftest test-ess-r-code-fill () "code-fill.R")
(elt-deftest test-ess-r-misc () "misc.R")
(elt-deftest test-ess-r-syntax () "syntax.R")
- [elpa] externals/ess updated (3bff8e738c -> 9f8b047ec1), ELPA Syncer, 2023/04/16
- [elpa] externals/ess 494b7f80a3 01/12: Remove ELT tests, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 342eee64d3 02/12: Port ELT roxy-mode tests to etest,
ELPA Syncer <=
- [elpa] externals/ess 5fc206d230 03/12: Port `ess-indent-exp` test to etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess e05d94066c 05/12: Add support for case reset in etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 5cbe4e6583 11/12: Remove ELT from ESS, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 3e005140d2 04/12: Port ELT syntax tests to etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 9f8b047ec1 12/12: Merge branch 'update-elt-tests', ELPA Syncer, 2023/04/16
- [elpa] externals/ess 76c24f4c22 06/12: Port ELT tests for R tokenification to etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 4ac22227c7 09/12: Move cycle assign tests to edit file, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 8e863733e5 07/12: Port ELT tests for R fontification to etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 31da9eddf8 08/12: Port ELT tests for R keybindings to etest, ELPA Syncer, 2023/04/16
- [elpa] externals/ess 0560c48717 10/12: Port ELT tests for R code filling to etest, ELPA Syncer, 2023/04/16