Commit Graph

11 Commits

Author SHA1 Message Date
Sean Farley
750f67f948 tests: remove unused variables from test-pathencode.py caught by pyflakes 2014-04-03 20:35:56 -05:00
Matt Mackall
db1209d4bd merge with stable 2013-06-21 15:31:40 -05:00
Siddharth Agarwal
d24e2a68a5 test-pathencode: randomize length of each path component
This makes it possible for long and short components to exist in the same path.
This also makes shorter path components more likely. For
randint(1, randint(1, n)), the likelihood that one sees a number k
(1 <= k <= n) is 1/n * (\sum_{k=i}^n 1/i). This decreases with k, much like in
the real world where shorter paths are more common than longer ones.

The previous fix and this one together cause issue3958 to be detected by this
test with reasonable frequency. When this test was run 100 times in a loop, the
issue was detected 30 of those times.
2013-06-19 23:05:40 -07:00
Siddharth Agarwal
a036161264 test-pathencode: reduce makepart length requirement by 1
This allows path components of length 1 to be generated.
2013-06-19 23:01:22 -07:00
Simon Heimberg
8a32578a00 cleanup: remove unused imports
detected by pyflakes
2013-06-13 01:36:58 +02:00
Bryan O'Sullivan
c4e1eeb2a3 store: switch to C-based hashed path encoding 2012-12-12 13:09:37 -08:00
Adrian Buehlmann
087143e7a1 test-pathencode: accept --seed parameter in hex as well
test-pathencode.py outputs the seed value in hex if it finds a deviation.

This change allows to specify the seed value as a command line
parameter for test-pathencode.py in hex as well.
2012-12-20 15:18:41 +01:00
Adrian Buehlmann
de02c4573a test-pathencode: compare current pathencoding implementations
We already have two implementations of the pathencoding (C and
Python) and this test can perfectly well be used to probabilistically
test them instead of just wasting CPU cycles and test time.
2012-12-19 10:02:43 +01:00
Bryan O'Sullivan
9d9a12dfce test-pathencode: more aggressively check for python < 2.6 2012-11-15 22:24:36 -08:00
Bryan O'Sullivan
2fb8bcbaf3 test-pathencode: make a 2.4-safe import of collections 2012-11-15 10:55:32 -08:00
Bryan O'Sullivan
0eefe45ac8 tests: add a randomized test for pathencode
This is a probabilistic test - it generates different test cases on every
run, unless invoked from the command line with a specific seed.

The default number of tests run should make the tests take about a
second to complete on a semi-modern laptop.
2012-11-15 10:04:29 -08:00