1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00

Test for error with multibyte strings in bindat.el

* test/lisp/emacs-lisp/bindat-tests.el
(bindat-test-pack/multibyte-string-fails)
(bindat-test-unpack/multibyte-string-fails): New tests.
This commit is contained in:
Stefan Kangas 2020-10-21 18:23:38 +02:00
parent 5215067c4e
commit 0d7d09b0ef

View File

@ -1,4 +1,4 @@
;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t; -*-
;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t; coding: utf-8; -*-
;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
@ -94,7 +94,13 @@
(src-ip .
[192 168 1 101])
(dest-ip .
[192 168 1 100]))))))
[192 168 1 100]))))))
(ert-deftest bindat-test-pack/multibyte-string-fails ()
(should-error (bindat-pack nil nil (decode-coding-string "ö" 'utf-8))))
(ert-deftest bindat-test-unpack/multibyte-string-fails ()
(should-error (bindat-unpack nil (decode-coding-string "ö" 'utf-8))))
(ert-deftest bindat-test-format-vector ()
(should (equal (bindat-format-vector [1 2 3] "%d" "x" 2) "1x2"))