Browse Source

Improve test

Verify that we don't raise an exceptions when it's not necessary (listing
without $EDITOR for example shouldn't raise anything)

Closes #3.
Leo 10 years ago
parent
commit
c8fa1e5dc4
2 changed files with 8 additions and 2 deletions
  1. 2 2
      src/const.ml
  2. 6 0
      test/env.sh

+ 2 - 2
src/const.ml

@@ -58,8 +58,8 @@ let home =
 ;;
 
 (* Get default editor *)
-let editor = (* If editor is not set, it gets "" *)
-    lazy (get_var "EDITOR")
+let editor = (* If editor is not set, it gets "", but an exeption is trowed *)
+    lazy (get_var ~exp:true "EDITOR")
 ;;
 
 (* Level of verbosity, used by Messages module *)

+ 6 - 0
test/env.sh

@@ -43,5 +43,11 @@ binary=../oclaunch.native
 # Should throw one error, about $HOME
 env -i $binary
 
+# An exception with $EDITOR
+env -u EDITOR $binary -m 0
+
 # Should throw no blocking error (2)
 env -u EDITOR $binary
+# No exception
+env -u EDITOR $binary -l
+