Permalink
Browse files

Implement test -e and test -h (#45)

  • Loading branch information...
icarroll authored and andychu committed Oct 9, 2017
1 parent 116879b commit b01362ddcbe411c063362ccb6345249da87ccdc5
Showing with 6 additions and 0 deletions.
  1. +6 −0 core/expr_eval.py
View
@@ -485,6 +485,9 @@ def Eval(self, node):
#self._AddErrorContext("Error from stat(%r): %s" % (s, e))
return False
if op_id == Id.BoolUnary_e:
return True
if op_id == Id.BoolUnary_f:
return stat.S_ISREG(mode)
@@ -500,6 +503,9 @@ def Eval(self, node):
if op_id == Id.BoolUnary_w:
return os.access(s, os.W_OK)
if op_id == Id.BoolUnary_h:
return stat.S_ISLNK(mode)
raise NotImplementedError(op_id)
if arg_type == OperandType.Str:

0 comments on commit b01362d

Please sign in to comment.