From 2eafcc9024af4a1facd5087216b457db5d7ed8cd Mon Sep 17 00:00:00 2001 From: Jörg Sommrey <28217714+jo-37@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:02:22 +0200 Subject: Solution to task 2 --- challenge-265/jo-37/perl/ch-2.pl | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 challenge-265/jo-37/perl/ch-2.pl diff --git a/challenge-265/jo-37/perl/ch-2.pl b/challenge-265/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..56929d721f --- /dev/null +++ b/challenge-265/jo-37/perl/ch-2.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl -s + +use v5.24; +use Test2::V0; +use List::AllUtils qw(pairmap min_by count_by); +use experimental 'signatures'; + +our ($tests, $examples); + +run_tests() if $tests || $examples; # does not return + +die < 'accbbb', 'abc', 'abbc'), + 'accbbb', 'example 1'; + is completing_word('Da2 abc' => 'abcm', 'baacd', 'abaadc'), + 'baacd', 'example 2'; + is completing_word('JB 007' => 'jj', 'bb', 'bjb'), + 'bjb', 'example 3'; + } + + SKIP: { + skip "tests" unless $tests; + } + + done_testing; + exit; +} -- cgit