Closed hauntsaninja closed 2 years ago
Oh, looks like someone else also filed #165
I added a test for string length.
I then stumbled across some interesting zsh behaviour. I thought I'd add a assert "$(randstr)" not_equal_to "$(randstr)"
, but to my surprise, this test failed. It looks like zsh's behaviour with RANDOM is kind of weird: https://stackoverflow.com/a/63559416. I don't think this affects our logic, but we could also switch to python -c "import string, random; print(''.join(random.choice(string.ascii_lowercase) for _ in range(4)))"
— let me know!
I added a test for string length.
I then stumbled across some interesting zsh behaviour. I thought I'd add a
assert "$(randstr)" not_equal_to "$(randstr)"
, but to my surprise, this test failed. It looks like zsh's behaviour with RANDOM is kind of weird: https://stackoverflow.com/a/63559416. I don't think this affects our logic, but we could also switch topython -c "import string, random; print(''.join(random.choice(string.ascii_lowercase) for _ in range(4)))"
— let me know!
Seems like there might be a risk that we end up with shadowed virtualenv names if we are not careful. I think it would be preferable to use python in this case :)
Thanks for the changes @hauntsaninja :)
We seem to make pretty minimal use of pwgen, and since it's a little bit bothersome to have an additional install everywhere I set up my shell, I figured a couple lines of rolling our own might be better.
Fixes #165