diff options
| author | Lars Ingebrigtsen | 2020-10-13 06:51:06 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-10-13 06:51:06 +0200 |
| commit | 12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3 (patch) | |
| tree | c68e82a585d8a760b569b536d8951e18166a9d9d /test/src | |
| parent | 45cb0403deeba1cc121147b1884e7fea6cd15338 (diff) | |
| download | emacs-12175a339e2a2214fdd0ab4e16d8d8b1e92a78d3.tar.gz 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.el | 6 |
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." | |||
| 500 | (should (eq (mod-test-identity 123) 123)) | 500 | (should (eq (mod-test-identity 123) 123)) |
| 501 | (should-not (call-interactively #'mod-test-identity))) | 501 | (should-not (call-interactively #'mod-test-identity))) |
| 502 | 502 | ||
| 503 | (ert-deftest module/unibyte () | ||
| 504 | (let ((result (mod-test-return-unibyte))) | ||
| 505 | (should (stringp result)) | ||
| 506 | (should (not (multibyte-string-p (mod-test-return-unibyte)))) | ||
| 507 | (should (equal result "foo\x00zot")))) | ||
| 508 | |||
| 503 | ;;; emacs-module-tests.el ends here | 509 | ;;; emacs-module-tests.el ends here |