Permalink
Browse files

Implement test -d.

Now 'make SHELL=~/git/oil/bin/osh' works again.
  • Loading branch information...
Andy Chu
Andy Chu committed Aug 30, 2017
1 parent f35d420 commit 077f76eaf58a03d51cc2596fafdc7013f443f0c6
Showing with 9 additions and 1 deletion.
  1. +3 −0 core/expr_eval.py
  2. +6 −1 spec/test-builtin.test.sh
View
@@ -485,6 +485,9 @@ def Eval(self, node):
if op_id == Id.BoolUnary_f:
return stat.S_ISREG(mode)
if op_id == Id.BoolUnary_d:
return stat.S_ISDIR(mode)
raise NotImplementedError(op_id)
if arg_type == OperandType.Str:
@@ -164,4 +164,9 @@ echo status=$?
# OK mksh stdout: status=2
# OK dash stdout: status=1
### -d
test -d $TMP
echo status=$?
test -d $TMP/__nonexistent_Z_Z__
echo status=$?
# stdout-json: "status=0\nstatus=1\n"

0 comments on commit 077f76e

Please sign in to comment.