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

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

[nongnu] elpa/forth-mode 59c5ea89ca: Better tests for forth-spec.el


From: ELPA Syncer
Subject: [nongnu] elpa/forth-mode 59c5ea89ca: Better tests for forth-spec.el
Date: Wed, 6 Dec 2023 06:59:31 -0500 (EST)

branch: elpa/forth-mode
commit 59c5ea89ca7593bd49cdde6caefa0893a8780105
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Lars Brinkhoff <lars@nocrew.org>

    Better tests for forth-spec.el
    
    * forth-spec.el (forth-spec--parse-2012): Not all words have a
      pronunciation.
    * test/tests.el (forth-spec-parsing): Apparently there are 450
      standard words.
---
 forth-spec.el | 3 ++-
 test/tests.el | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/forth-spec.el b/forth-spec.el
index 697ad0e437..4102b68a14 100644
--- a/forth-spec.el
+++ b/forth-spec.el
@@ -137,7 +137,8 @@ Note: the string should have a trailing backslash."
   (let ((index '())
        (case-fold-search nil)
        (rx "</td><td><a href=\"\\([^\"]+\\)\">\
-\\([^<]+\\)</a></td><td>\"\\([^\"]+\\)\"</td><td[^<]*>[^<]*</td></tr>"))
+\\([^<]+\\)</a></td><td>\\(:?\"\\([^\"]+\\)\"\\)?</td>\
+<td[^<]*>[^<]*</td></tr>"))
     (search-forward "<table")
     (while (re-search-forward rx nil t)
       (push (list (forth-spec--decode-entities (match-string 2))
diff --git a/test/tests.el b/test/tests.el
index c7133b4980..0f8d639a83 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -371,7 +371,11 @@ The whitespace before and including \"|\" on each line is 
removed."
   (should (equal (forth-spec--build-url "SWAP" 1994)
                 "http://lars.nocrew.org/dpans/dpans6.htm#6.1.2260";))
   (should (string-match "core/ColonNONAME"
-                       (forth-spec--build-url ":NONAME" 2012))))
+                       (forth-spec--build-url ":NONAME" 2012)))
+  (should (string-match "memory/ALLOCATE"
+                       (forth-spec--build-url "ALLOCATE" 2012)))
+  (should (= (length (cdr (assoc 2012 forth-spec--index-cache)))
+            450)))
 
 (ert-deftest forth-fill-comment ()
   (forth-should-before/after



reply via email to

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