From 41bfb91f5db878d139d5c0c631c569475018a7c2 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 17 Nov 2019 08:16:53 +0100 Subject: [PATCH] add comp-tests-jump-table-2-f --- test/src/comp-test-funcs.el | 5 +++++ test/src/comp-tests.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index 3ba12dc2a6a..ca604b748f3 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el @@ -111,6 +111,11 @@ ('y 'b) (_ 'c))) +(defun comp-tests-jump-table-2-f (x) + (pcase x + ("aaa" 'a) + ("bbb" 'b))) + (defun comp-tests-conditionals-1-f (x) ;; Generate goto-if-nil (if x 1 2)) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index a76a4a8c469..0a1d45724fa 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -168,7 +168,11 @@ Check that the resulting binaries do not differ." "Testing jump tables" (should (eq (comp-tests-jump-table-1-f 'x) 'a)) (should (eq (comp-tests-jump-table-1-f 'y) 'b)) - (should (eq (comp-tests-jump-table-1-f 'xxx) 'c))) + (should (eq (comp-tests-jump-table-1-f 'xxx) 'c)) + + ;; Jump table not with eq as test + (should (eq (comp-tests-jump-table-2-f "aaa") 'a)) + (should (eq (comp-tests-jump-table-2-f "bbb") 'b))) (ert-deftest comp-tests-conditionals () "Testing conditionals." -- 2.39.5