aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/network-stream-tests.el52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
index 28686547a44..7a982548ae1 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -724,4 +724,56 @@
724 44777 724 44777
725 (vector :nowait t)))) 725 (vector :nowait t))))
726 726
727(ert-deftest check-network-process-coding-system-bind ()
728 "Check that binding coding-system-for-{read,write} works."
729 (let* ((coding-system-for-read 'binary)
730 (coding-system-for-write 'utf-8-unix)
731 (server
732 (make-network-process
733 :name "server"
734 :server t
735 :noquery t
736 :family 'ipv4
737 :service t
738 :host 'local))
739 (coding (process-coding-system server)))
740 (should (eq (car coding) 'binary))
741 (should (eq (cdr coding) 'utf-8-unix))
742 (delete-process server)))
743
744(ert-deftest check-network-process-coding-system-no-override ()
745 "Check that coding-system-for-{read,write} is not overridden by :coding nil."
746 (let* ((coding-system-for-read 'binary)
747 (coding-system-for-write 'utf-8-unix)
748 (server
749 (make-network-process
750 :name "server"
751 :server t
752 :noquery t
753 :family 'ipv4
754 :service t
755 :coding nil
756 :host 'local))
757 (coding (process-coding-system server)))
758 (should (eq (car coding) 'binary))
759 (should (eq (cdr coding) 'utf-8-unix))
760 (delete-process server)))
761
762(ert-deftest check-network-process-coding-system-override ()
763 "Check that :coding non-nil overrides coding-system-for-{read,write}."
764 (let* ((coding-system-for-read 'binary)
765 (coding-system-for-write 'utf-8-unix)
766 (server
767 (make-network-process
768 :name "server"
769 :server t
770 :noquery t
771 :family 'ipv4
772 :service t
773 :coding 'georgian-academy
774 :host 'local))
775 (coding (process-coding-system server)))
776 (should (eq (car coding) 'georgian-academy))
777 (should (eq (cdr coding) 'georgian-academy))
778 (delete-process server)))
727;;; network-stream-tests.el ends here 779;;; network-stream-tests.el ends here