[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master fcb3821 2/2: Also test unpacking
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master fcb3821 2/2: Also test unpacking |
Date: |
Sat, 15 Jun 2019 10:10:45 -0400 (EDT) |
branch: master
commit fcb3821ad506675bce264e53f50a06905adaa8e8
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Also test unpacking
---
test/lisp/emacs-lisp/bindat-tests.el | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/test/lisp/emacs-lisp/bindat-tests.el
b/test/lisp/emacs-lisp/bindat-tests.el
index 854fd5b..f6af810 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