aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2019-06-16 15:32:29 +0200
committerAndrea Corallo2020-01-01 11:33:42 +0100
commit1510e15c3c709130ded1569fb1faee4e885c0ff8 (patch)
treeef850fafd9a22b7e3f7d77a0c0487f6d667ffddd
parent0c7115c7b894c8e1655a0d5e482cc7ed8b231506 (diff)
downloademacs-1510e15c3c709130ded1569fb1faee4e885c0ff8.tar.gz
emacs-1510e15c3c709130ded1569fb1faee4e885c0ff8.zip
Binsert support
-rw-r--r--src/comp.c3
-rw-r--r--test/src/comp-tests.el14
2 files changed, 14 insertions, 3 deletions
diff --git a/src/comp.c b/src/comp.c
index f19fc84479b..134d1baabcd 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1945,7 +1945,8 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
1945 break; 1945 break;
1946 1946
1947 case BinsertN: 1947 case BinsertN:
1948 error ("BinsertN not supported"); 1948 op = FETCH;
1949 EMIT_SCRATCH_CALL_N ("Finsert", op);
1949 break; 1950 break;
1950 1951
1951 case Bstack_set: 1952 case Bstack_set:
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index f1acc42b8ca..931b9e06094 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -314,12 +314,22 @@
314 (1+ (let ((a 1) 314 (1+ (let ((a 1)
315 (_b) 315 (_b)
316 (_c)) 316 (_c))
317 a))) 317 a)))
318 (defun comp-tests-insertn-f (a b c d)
319 ;; Binsert
320 (insert a b c d))
318 321
319 (byte-compile #'comp-tests-discardn-f) 322 (byte-compile #'comp-tests-discardn-f)
320 (native-compile #'comp-tests-discardn-f) 323 (native-compile #'comp-tests-discardn-f)
324 (byte-compile #'comp-tests-insertn-f)
325 (native-compile #'comp-tests-insertn-f)
321 326
322 (should (= (comp-tests-discardn-f 10) 2))) 327 (should (= (comp-tests-discardn-f 10) 2))
328
329 (should (string= (with-temp-buffer
330 (comp-tests-insertn-f "a" "b" "c" "d")
331 (buffer-string))
332 "abcd")))
323 333
324(ert-deftest comp-tests-gc () 334(ert-deftest comp-tests-gc ()
325 "Try to do some longer computation to let the gc kick in." 335 "Try to do some longer computation to let the gc kick in."