tests: fix a bug in `f` that prevented calculating sha1sum on a file
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 20 Dec 2017 20:41:12 -0500
changeset 35471 ea4d27aac557
parent 35470 a33be093ec62
child 35472 c1f7037c2ded
tests: fix a bug in `f` that prevented calculating sha1sum on a file
tests/f
tests/test-tools.t
--- a/tests/f	Thu Dec 21 22:17:39 2017 +0900
+++ b/tests/f	Wed Dec 20 20:41:12 2017 -0500
@@ -59,7 +59,7 @@
         if isfile:
             if opts.type:
                 facts.append('file')
-            if opts.hexdump or opts.dump or opts.md5:
+            if opts.hexdump or opts.dump or opts.md5 or opts.sha1:
                 content = open(f, 'rb').read()
         elif islink:
             if opts.type:
--- a/tests/test-tools.t	Thu Dec 21 22:17:39 2017 +0900
+++ b/tests/test-tools.t	Wed Dec 20 20:41:12 2017 -0500
@@ -38,6 +38,9 @@
   $ f foo
   foo:
 
+  $ f --sha1 foo
+  foo: sha1=f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
+
 #if symlink
   $ f foo --mode
   foo: mode=644