File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,15 @@ Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="
8686
8787; ; utility functions
8888
89+ (defun impostman-version (&optional print-dest )
90+ " Return the Impostman version.
91+
92+ PRINT-DEST is the output stream, by default the echo area.
93+
94+ With \\ [universal-argument] prefix, output is in the current buffer."
95+ (interactive (list (if current-prefix-arg (current-buffer ) t )))
96+ (princ (format " impostman %s " impostman-version) print-dest))
97+
8998(defun impostman-format-comment (comment &optional prefix )
9099 " Format a comment, which can be on multiple lines.
91100
Original file line number Diff line number Diff line change 4141 (insert-file-contents filename)
4242 (buffer-string )))
4343
44+ (ert-deftest impostman-test-version ()
45+ " Test Impostman version."
46+ (let ((impostman-version-output (impostman-version))
47+ (expected-string-version (concat " impostman " impostman-version)))
48+ ; ; version must include at least 3 digits, separated by dots
49+ (should (string-match " ^impostman [0-9]+\\ .[0-9]+\\ .[0-9]+"
50+ impostman-version-output))
51+ (should (equal impostman-version-output expected-string-version))))
52+
4453(ert-deftest impostman-test-format-comment ()
4554 " Test the format of comment."
4655 ; ; without prefix: default is "# "
You can’t perform that action at this time.
0 commit comments