diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-06-15 16:10:28 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-06-15 16:10:28 +0200 |
commit | fcb3821ad506675bce264e53f50a06905adaa8e8 (patch) | |
tree | f93bec8c35b65cee2c64979731b885c2c114c90a /test/lisp/emacs-lisp | |
parent | f03343747e380174400ac0529030dc4d35bea715 (diff) | |
download | emacs-fcb3821ad506675bce264e53f50a06905adaa8e8.tar.gz emacs-fcb3821ad506675bce264e53f50a06905adaa8e8.tar.bz2 emacs-fcb3821ad506675bce264e53f50a06905adaa8e8.zip |
Also test unpacking
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/bindat-tests.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el index 854fd5b62d5..f6af810083a 100644 --- a/test/lisp/emacs-lisp/bindat-tests.el +++ b/test/lisp/emacs-lisp/bindat-tests.el @@ -70,4 +70,30 @@ 2 3 5 0 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0 1 4 7 0 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]))) +(ert-deftest bindat-test-unpack () + (should (equal + (bindat-unpack packet-bindat-spec + (bindat-pack packet-bindat-spec struct-bindat)) + '((item + ((data . + [1 2 3 4 5]) + (id . "ABCDEF") + (length . 5) + (opcode . 3) + (type . 2)) + ((data . + [6 7 8 9 10 11 12]) + (id . "BCDEFG") + (length . 7) + (opcode . 4) + (type . 1))) + (items . 2) + (header + (src-port . 5408) + (dest-port . 284) + (src-ip . + [192 168 1 101]) + (dest-ip . + [192 168 1 100])))))) + ;;; bindat-tests.el ends here |