summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/bindat-tests.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el
index 8bb3baa485e..7d1233ded7c 100644
--- a/test/lisp/emacs-lisp/bindat-tests.el
+++ b/test/lisp/emacs-lisp/bindat-tests.el
@@ -240,7 +240,12 @@
(ert-deftest bindat-test--strz-varlen-pack ()
(should (equal (bindat-pack spec "") "\0"))
- (should (equal (bindat-pack spec "abc") "abc\0")))
+ (should (equal (bindat-pack spec "abc") "abc\0"))
+ ;; Null bytes in the input string break unpacking.
+ (should-error (bindat-pack spec "\0"))
+ (should-error (bindat-pack spec "\0x"))
+ (should-error (bindat-pack spec "x\0"))
+ (should-error (bindat-pack spec "x\0y")))
(ert-deftest bindat-test--strz-varlen-unpack ()
(should (equal (bindat-unpack spec "\0") ""))