Mercurial > hg
diff hgext/factotum.py @ 31763:8a0c47982ade
test-revlog-raw: fix "genbits" implementation
The "genbits" implementation is actually incorrect. This patch fixes it. A
good "genbits" implementation should pass the below assertion:
n = 3 # or other number
l = list(genbits(n))
assert 2**(n*2) == len(set((l[i]<<n)+l[i+1] for i in range(len(l)-1)))
An assertion is added to make sure "genbits" won't work unexpectedly.
author | Jun Wu <quark@fb.com> |
---|---|
date | Sun, 02 Apr 2017 18:12:47 -0700 |
parents | 2c019aac6b99 |
children | 21b568820a3c |