Skip to content

Commit

Permalink
fix enum error test for real this time
Browse files Browse the repository at this point in the history
The error messages generated by type validations are not consistent, and
will be different if Devel::PartialDump is installed.
  • Loading branch information
haarg committed Oct 21, 2020
1 parent 160a1ed commit 5831032
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/type_constraints/enum.t
Expand Up @@ -82,6 +82,6 @@ like( exception {
}, qr/enum called with an array reference and additional arguments\. Did you mean to parenthesize the enum call's parameters\?/ );

my $enum_msg_test = Moose::Meta::TypeConstraint::Enum->new(name => 'EnumMessageTest', values => \@valid_languages);
is $enum_msg_test->get_message($invalid_languages[0]), qq[Validation failed for 'EnumMessageTest' with value "$invalid_languages[0]". Value must be equal to "PASM", "PIR", "Perl 5", or "Perl 6".];
like $enum_msg_test->get_message($invalid_languages[0]), qr[\AValidation failed for 'EnumMessageTest' with value "?\Q$invalid_languages[0]\E"?\. Value must be equal to "PASM", "PIR", "Perl 5", or "Perl 6"\.\z];

done_testing;

0 comments on commit 5831032

Please sign in to comment.