Peter Szilagyi  committed 5933ce2

updated Omake.Env.value-p unit tests and hooked up to 'omake runtest'

  • Participants
  • Parent commits 71999fb
  • Branches default

Comments (0)

Files changed (3)

File elisp/omake/OMakefile

-runtest: Makefile
-	make all clean
+runtest: Makefile $(glob *.el)
+	make all test clean

File elisp/omake/omake-env.el

 (defun Omake.Env.value-p (v)
   "Environment variables are sent from ocaml as the symbols 'true and 'false."
-  (assert (symbolp v))
   (case v
     ((true false nil) t)
     (t nil)))

File elisp/omake/omake-unit-tests.el

   (should (Omake.Env.value-p 'true))
   (should (Omake.Env.value-p 'false))
   (should-not (Omake.Env.value-p t))
-  (should-not (Omake.Env.value-p nil)))
+  (should (Omake.Env.value-p nil))
+  (should-not (Omake.Env.value-p "true"))
+  (should-not (Omake.Env.value-p "false"))
+  (should-not (Omake.Env.value-p "nil"))
+  (should-not (Omake.Env.value-p 'symbol))
+  (should-not (Omake.Env.value-p '(true)))
+  (should-not (Omake.Env.value-p '(false)))
+  (should-not (Omake.Env.value-p '(nil)))
+  )
 (ert-deftest Omake.Env.not ()
   (should (equal (Omake.Env.not 'true) 'false))