This doesn't come with an elaborate test suite, but it does pretty much everything that does in a few dozen lines of Perl.
https://github.com/neilk/misc/blob/master/randline
I've had this script (or versions of it) around for more than a decade. I didn't know the technique had a name.