D2236: tests: remove use of bashism $RANDOM to fix test-narrow.t on non-bash shells

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue Feb 13 23:03:00 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This test passed on our workstations, including on Macs, so we never
  noticed, but it fails on both the Linux and FreeBSD buildbots. Today I
  learned about a bash feature, wherein $RANDOM gives a random int every
  time you read it.
  
  check-code rule to follow.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2236

AFFECTED FILES
  tests/test-narrow.t

CHANGE DETAILS

diff --git a/tests/test-narrow.t b/tests/test-narrow.t
--- a/tests/test-narrow.t
+++ b/tests/test-narrow.t
@@ -51,7 +51,7 @@
   [255]
 
 Names with '.' in them are OK.
-  $ hg clone --narrow ssh://user@dummy/master $RANDOM --include a/.b/c
+  $ hg clone --narrow ssh://user@dummy/master should-work --include a/.b/c
   requesting all changes
   adding changesets
   adding manifests



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list