summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-10-13 06:51:06 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-10-13 06:51:06 +0200
commit12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3 (patch)
treec68e82a585d8a760b569b536d8951e18166a9d9d /test/src
parent45cb0403deeba1cc121147b1884e7fea6cd15338 (diff)
downloademacs-12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3.tar.gz
emacs-12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3.tar.bz2
emacs-12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3.zip
Allow creating unibyte strings from Emacs modules
* doc/lispref/internals.texi (Module Values): Document make_unibyte_string (bug#34873). * src/emacs-module.c (module_make_unibyte_string): New function. (initialize_environment): Export it. * src/module-env-25.h: Define it. * test/data/emacs-module/mod-test.c (Fmod_test_return_unibyte): Test it. * test/src/emacs-module-tests.el (module/unibyte): Test it.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/emacs-module-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 1eebb418cf3..621229c62aa 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -500,4 +500,10 @@ See Bug#36226."
(should (eq (mod-test-identity 123) 123))
(should-not (call-interactively #'mod-test-identity)))
+(ert-deftest module/unibyte ()
+ (let ((result (mod-test-return-unibyte)))
+ (should (stringp result))
+ (should (not (multibyte-string-p (mod-test-return-unibyte))))
+ (should (equal result "foo\x00zot"))))
+
;;; emacs-module-tests.el ends here