]> git.ipfire.org Git - thirdparty/git.git/commit
t0021: refactor `generate_random_characters()` to not depend on Perl
authorPatrick Steinhardt <ps@pks.im>
Thu, 3 Apr 2025 05:06:08 +0000 (07:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:47:40 +0000 (14:47 -0700)
commit88ed7b84cd97a0bafeeecefe6e7649eec090e02b
tree6f2699d2333f92d711870abd8a4f5c641acc5c50
parentcee137b7e53403fe9170c9aeb758fa946b2f0c4c
t0021: refactor `generate_random_characters()` to not depend on Perl

The `generate_random_characters()` helper function generates N
random characters in the range 'a-z' and writes them into a file. The
logic currently uses Perl, but it can be adapted rather easily by:

  - Making `test-tool genrandom` generate an infinite stream.

  - Using `tr -dc` to strip all characters which aren't in the range of
    'a-z'.

  - Using `test_copy_bytes()` to copy the first N bytes.

This allows us to drop the PERL_TEST_HELPERS prerequisite.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0021-conversion.sh