aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2019-07-06 16:43:09 +0200
committerAndrea Corallo2020-01-01 11:33:49 +0100
commitccc719b230776b856aa4bf581ff19fd681a1aa56 (patch)
treee4237e88d660fc189676945f7692949a0a7f4e5f /test/src
parent98b500a0a21b486a98bf4e1ae989fd38616164bc (diff)
downloademacs-ccc719b230776b856aa4bf581ff19fd681a1aa56.tar.gz
emacs-ccc719b230776b856aa4bf581ff19fd681a1aa56.zip
jump table support
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index d732d558cdd..b6a8904347f 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -218,6 +218,21 @@
218 218
219 (should (= (comp-tests-ffuncall-lambda-f 1) 2))) 219 (should (= (comp-tests-ffuncall-lambda-f 1) 2)))
220 220
221(ert-deftest comp-tests-jump-table ()
222 "Testing jump tables"
223 (defun comp-tests-jump-table-1-f (x)
224 (pcase x
225 ('x 'a)
226 ('y 'b)
227 (_ 'c)))
228
229 (byte-compile #'comp-tests-jump-table-1-f)
230 (byte-compile #'comp-tests-jump-table-1-f)
231
232 (should (eq (comp-tests-jump-table-1-f 'x) 'a))
233 (should (eq (comp-tests-jump-table-1-f 'y) 'b))
234 (should (eq (comp-tests-jump-table-1-f 'xxx) 'c)))
235
221(ert-deftest comp-tests-conditionals () 236(ert-deftest comp-tests-conditionals ()
222 "Testing conditionals." 237 "Testing conditionals."
223 (defun comp-tests-conditionals-1-f (x) 238 (defun comp-tests-conditionals-1-f (x)