The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/perl -w

BEGIN { $ENV{TESTING} = 1 }

use strict;
use warnings;
use List::Util qw/sum/;
use Test::More;
#use Test::NoWarnings;
use Getopt::Alt::Option;

my @invalid = qw(
    |test
    test=q
    test=q-
    test=i-
    a||b
);

plan tests => scalar @invalid;# + 1;

for my $args (@invalid) {
    my $opt;
    eval {
        $opt = Getopt::Alt::Option->new( $args );
    };

    ok( $@ || !$opt, "'$args' should fail" );
    diag Dumper $opt if $opt;
}