summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-06-27 18:43:58 +0000
committerJim Meyering <jim@meyering.net>2006-06-27 18:43:58 +0000
commitdf96ded8aea73b5134d800865534548b46f79283 (patch)
tree2c61ba3de125b34a4d5007113ddaf78ebb3ebfcb /tests
parent80059da4ca0feb6fd9f94e424454fa20f66e9e84 (diff)
downloadcoreutils-df96ded8aea73b5134d800865534548b46f79283.tar.xz
* tests/misc/cat-proc: Try to avoid any spurious numeric
differences in frequently-changing /proc/cpuinfo. Reported by Nelson Beebe.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/cat-proc7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc
index 69e206514..b53864ef5 100755
--- a/tests/misc/cat-proc
+++ b/tests/misc/cat-proc
@@ -32,9 +32,10 @@ fail=0
# Yes, parts of /proc/cpuinfo might change between cat runs.
# If that happens, consider choosing a file that's less likely to change,
-# or just filter out the changing lines.
-cat -E $f | tr -d '$' > out || fail=1
-cat $f | tr -d '$' > exp || fail=1
+# or just filter out the changing lines. The sed filter should help
+# to avoid any spurious numeric differences.
+cat -E $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > out || fail=1
+cat $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > exp || fail=1
cmp out exp || fail=1
test $fail = 1 && diff out exp 2> /dev/null