]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: unit tests for fuel, only 2 so far but the number is expected to grow
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 1 Nov 2014 21:11:48 +0000 (22:11 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 4 Nov 2014 15:40:16 +0000 (07:40 -0800)
misc/fuel/fuel-tests.el [new file with mode: 0644]

diff --git a/misc/fuel/fuel-tests.el b/misc/fuel/fuel-tests.el
new file mode 100644 (file)
index 0000000..9d60a5e
--- /dev/null
@@ -0,0 +1,35 @@
+;;; fuel-tests.el -- unit tests for fuel
+
+;; Copyright (C) 2014 Björn Lindqvist
+;; See http://factorcode.org/license.txt for BSD license.
+
+;; Author: Björn Lindqvist <bjourne@gmail.com>
+;; Keywords: languages, fuel, factor
+;; Start date: Sat Nov 01, 2014
+
+;;; Commentary:
+
+;; Run the test suite using M-x ert RET t RET or:
+;;
+;;     emacs -batch -l ert -l misc/fuel/fuel-tests.el \
+;;         -f ert-run-tests-batch-and-exit
+
+;;; Code:
+
+;; Load fuel from the same directory the tests are in.
+(add-to-list 'load-path (file-name-directory load-file-name))
+
+(require 'ert)
+(require 'fuel-markup)
+
+;; fuel-markup
+(ert-deftest print-str ()
+  (should (equal (fuel-markup--print-str "hello") "hello")))
+
+(ert-deftest quotation ()
+  (let ((quot '($quotation (effect ("args" "kw") ("ret") nil nil nil))))
+    (should (equal
+             (with-temp-buffer
+               (fuel-markup--quotation quot)
+               (buffer-string))
+             "a quotation with stack effect ( args kw -- ret )"))))