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

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

[elpa] externals/phps-mode fb9905f 19/96: Added basic translation test


From: Christian Johansson
Subject: [elpa] externals/phps-mode fb9905f 19/96: Added basic translation test
Date: Fri, 29 Oct 2021 11:14:35 -0400 (EDT)

branch: externals/phps-mode
commit fb9905f9ea475005528dbc7e5267c707b9ca0824
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Added basic translation test
---
 phps-mode-parser.el           | 2 +-
 test/phps-mode-test-parser.el | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/phps-mode-parser.el b/phps-mode-parser.el
index 6521d1a..fc84c3b 100644
--- a/phps-mode-parser.el
+++ b/phps-mode-parser.el
@@ -55,7 +55,7 @@
 
 (defconst
   phps-mode-parser--table-translations
-  #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 
data ())
+  #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 
data (333 (lambda(data) (message data) nil) 411 (lambda(data) data) 459 
(lambda(data) data) 466 (lambda(data) data) ))
   "The hash-table of translations.")
 
 (defconst
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 08d8a86..95e3537 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -147,6 +147,15 @@
          '(80 459 466 411 333 332 154 102 79 155 102 79 459 466 411 333 332 
154 102 79 155 102 79)
          parse)))))
 
+  (phps-mode-test-parser--buffer-contents
+   "<?php echo 'hello'; ?>"
+   "Basic translation test of echo with open tag and close tag"
+   (lambda()
+     (should
+      (equal
+       '(nil ("echo" nil ";"))
+       (phps-mode-parser-translate)))))
+
   (message "\n-- Ran tests for parser boundaries. --"))
 
 (defun phps-mode-test-parser ()



reply via email to

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