]> git.eshelyaron.com Git - emacs.git/commitdiff
add comp-tests-jump-table-2-f
authorAndrea Corallo <akrl@sdf.org>
Sun, 17 Nov 2019 07:16:53 +0000 (08:16 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:07 +0000 (11:38 +0100)
test/src/comp-test-funcs.el
test/src/comp-tests.el

index 3ba12dc2a6ac38f655e1c32ee3be318846443c59..ca604b748f3af7142893943a9406c1d39a01f2cc 100644 (file)
     ('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))
index a76a4a8c469afe59e73d436f2b5e219d60ddb996..0a1d45724fa74d7ba07e119a1c256a24df710c5b 100644 (file)
@@ -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."