fixed the same value always generated for 256-divisor chars

This commit is contained in:
Oleg Ivanov 2014-08-10 00:37:31 +10:00
parent 1b691aeab2
commit 28e216136a
2 changed files with 6 additions and 1 deletions

View file

@ -50,4 +50,9 @@ func TestNewLenChars(t *testing.T) {
}
// Check that only allowed characters are present
validateChars(t, u, chars)
// Check that two generated strings are different
u2 := NewLenChars(length, chars)
if u == u2 {
t.Fatalf("not unique: %q and %q", u, u2)
}
}