From 2ac39bb4fab648b5a1715c553c2aa5c75c80819c Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Mon, 15 Oct 2018 23:13:38 +0200 Subject: [PATCH] Move tests to separate file --- test.el | 26 ++++++++++++++++++++++++++ testdata/stomp_message.txt | Bin 0 -> 32 bytes testdata/stomp_message_cr.txt | Bin 0 -> 45 bytes 3 files changed, 26 insertions(+) create mode 100755 test.el create mode 100644 testdata/stomp_message.txt create mode 100644 testdata/stomp_message_cr.txt diff --git a/test.el b/test.el new file mode 100755 index 0000000..b53260a --- /dev/null +++ b/test.el @@ -0,0 +1,26 @@ +#!/bin/sh +":"; exec emacs -Q --script "$0" -- "$@" + +(setq cwd default-directory) + +(defun stomp-message-buffer (test-file) + "Create a buffer with a stomp message in it for testing purposes" + (find-file (format "%s/testdata/%s" cwd test-file))) + +(defun simple-message-buffer () + "Simple buffer to be used for testing" + (stomp-message-buffer "stomp_message.txt")) + +(defun carriage-return-message-buffer () + "Simple buffer with carriage returns" + (stomp-message-buffer "stomp_message_cr.txt")) + +(load (format "%sstomp.el" default-directory) nil t) + +;; Simple test for basic buffer +(pp (stomp-read-message (simple-message-buffer))) + +;; Test for buffer containing carriage returns +(pp (stomp-read-message (carriage-return-message-buffer))) + + diff --git a/testdata/stomp_message.txt b/testdata/stomp_message.txt new file mode 100644 index 0000000000000000000000000000000000000000..b7dc5f8000a41e337cd9f6045f646c7021bdc22b GIT binary patch literal 32 ncmZ?rapWq_&rQ|MNKH&hEwU<0%qdOf%Fnh+s!ZkLV&DP*u(S#H literal 0 HcmV?d00001 diff --git a/testdata/stomp_message_cr.txt b/testdata/stomp_message_cr.txt new file mode 100644 index 0000000000000000000000000000000000000000..e1a94c59d1cce3089bf150737ddefebbeb6e93ea GIT binary patch literal 45 ycmZ?rapdJH&d*KN%}7m5NiDJ}OUx-v<>kuHwo0l5(!5;B`FSO&c_my7yj%c6$_+gL literal 0 HcmV?d00001