-
-
Save hitode909/159fabc2cdc08209474c to your computer and use it in GitHub Desktop.
smartmatch最悪
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use experimental 'smartmatch'; | |
use Test::More tests => 5; | |
sub in_tripartite_pact { | |
my ($country) = @_; | |
return $country ~~ ['Japan', 'Germany', 'Italy']; | |
} | |
ok in_tripartite_pact('Japan'), 'Japan signed the pact.'; | |
ok in_tripartite_pact('Germany'), 'Germany signed the pact.'; | |
ok in_tripartite_pact('Italy'), 'Italy signed the pact.'; | |
ok ! in_tripartite_pact('America'), "America didn't signed the pact."; | |
ok in_tripartite_pact(['Japan', 'Germany', 'Italy']), '最悪'; | |
# % prove -v a.pl | |
# a.pl .. | |
# 1..5 | |
# ok 1 - Japan signed the pact. | |
# ok 2 - Germany signed the pact. | |
# ok 3 - Italy signed the pact. | |
# ok 4 - America didn't signed the pact. | |
# ok 5 - 最悪 | |
# ok | |
# All tests successful. | |
# Files=1, Tests=5, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr 0.00 csys = 0.06 CPU) | |
# Result: PASS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment