tests: teach f not to report directory size
authorMatt Mackall <mpm@selenic.com>
Sat, 17 Jan 2015 13:53:16 -0800
changeset 23911 593a5cd709a2
parent 23910 759df5197e9a
child 23912 7d0aa6269ece
tests: teach f not to report directory size It's not meaningful or portable
tests/f
tests/test-tools.t
--- a/tests/f	Sat Jan 17 13:44:43 2015 -0800
+++ b/tests/f	Sat Jan 17 13:53:16 2015 -0800
@@ -61,7 +61,7 @@
             facts.append('type unknown')
         if not isstdin:
             stat = os.lstat(f)
-            if opts.size:
+            if opts.size and not isdir:
                 facts.append('size=%s' % stat.st_size)
             if opts.mode:
                 facts.append('mode=%o' % (stat.st_mode & 0777))
--- a/tests/test-tools.t	Sat Jan 17 13:44:43 2015 -0800
+++ b/tests/test-tools.t	Sat Jan 17 13:53:16 2015 -0800
@@ -65,7 +65,7 @@
 #if unix-permissions symlink
   $ ln -s yadda l
   $ f . --recurse -MStmsB4
-  .: directory with 4 files, size=*, mode=755 (glob)
+  .: directory with 4 files, mode=755
   ./bar: file, size=21, mode=755, md5=3b03, sha1=612c
   ./baz: file, size=21, mode=755, md5=3b03, sha1=612c
   ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2