Hi,
It seems to me that the last line of the first test (“Can generate a random key”) of the “Simple Cipher” problem in Bash is incorrect. Should it be like this?
[[ "$key" =~ ^[[:lower:]]*$ ]]
Hi,
It seems to me that the last line of the first test (“Can generate a random key”) of the “Simple Cipher” problem in Bash is incorrect. Should it be like this?
[[ "$key" =~ ^[[:lower:]]*$ ]]
Yeah, that is a bug.
The existing tests are
assert [ "${#key}" -ge 100 ] # at least 100 chars
[[ $key != [^[:lower:]] ]] # only lowercase letters
The == and != operators do glob-style pattern matching. That pattern checks that the key isn’t a single character that is a non-lower.
In your regex, I’d just change *
to +
Feel like creating a PR?
Sure. It’s done.