diff options
| author | Andrea Corallo | 2019-06-30 17:42:30 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:33:48 +0100 |
| commit | aa312e07b7a9d3e952ccb59abfe9e03dc977217e (patch) | |
| tree | a85bf83a0a7e99e881dbaa9825f83c8e19c9e186 /test/src | |
| parent | c4b003f3c8d4a7e508b3f8d72e46829735ffbcbd (diff) | |
| download | emacs-aa312e07b7a9d3e952ccb59abfe9e03dc977217e.tar.gz emacs-aa312e07b7a9d3e952ccb59abfe9e03dc977217e.zip | |
add primitve call test
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/comp-tests.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index d2b8f56d36f..125af64b569 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -153,15 +153,25 @@ | |||
| 153 | (should (string= (comp-tests-concat-f "bar") "abcdabcabfoobar"))) | 153 | (should (string= (comp-tests-concat-f "bar") "abcdabcabfoobar"))) |
| 154 | 154 | ||
| 155 | (ert-deftest comp-tests-ffuncall () | 155 | (ert-deftest comp-tests-ffuncall () |
| 156 | "Testing varset." | 156 | "Test calling conventions." |
| 157 | (defun comp-tests-ffuncall-callee-f (x y z) | 157 | (defun comp-tests-ffuncall-callee-f (x y z) |
| 158 | (list x y z)) | 158 | (list x y z)) |
| 159 | (defun comp-tests-ffuncall-caller-f () | 159 | (defun comp-tests-ffuncall-caller-f () |
| 160 | (comp-tests-ffuncall-callee-f 1 2 3)) | 160 | (comp-tests-ffuncall-callee-f 1 2 3)) |
| 161 | |||
| 161 | (byte-compile #'comp-tests-ffuncall-caller-f) | 162 | (byte-compile #'comp-tests-ffuncall-caller-f) |
| 162 | (native-compile #'comp-tests-ffuncall-caller-f) | 163 | (native-compile #'comp-tests-ffuncall-caller-f) |
| 163 | 164 | ||
| 164 | (should (equal (comp-tests-ffuncall-caller-f) '(1 2 3)))) | 165 | (should (equal (comp-tests-ffuncall-caller-f) '(1 2 3))) |
| 166 | |||
| 167 | (defun comp-tests-ffuncall-native-f () | ||
| 168 | "Call a primitive with no dedicate op." | ||
| 169 | (make-vector 1 nil)) | ||
| 170 | |||
| 171 | (byte-compile #'comp-tests-ffuncall-native-f) | ||
| 172 | (native-compile #'comp-tests-ffuncall-native-f) | ||
| 173 | |||
| 174 | (should (vectorp (comp-tests-ffuncall-native-f)))) | ||
| 165 | 175 | ||
| 166 | (ert-deftest comp-tests-conditionals () | 176 | (ert-deftest comp-tests-conditionals () |
| 167 | "Testing conditionals." | 177 | "Testing conditionals." |