diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-06-15 16:46:40 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-06-15 16:46:40 +0100 |
commit | 1b0114aa9aafb612b73205989b1316ba1dfd4857 (patch) | |
tree | 10066897d72c9112107a962769b4b22d73e37455 | |
parent | 815ce1e98c6024ec0ea4b2843981a00bfd88507e (diff) |
Test (currently failing) for odd double call behaviour in in_gb_locale
-rw-r--r-- | t/i18n.t | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -106,4 +106,16 @@ sub utf8_diag { \@NO_sorted, "sort strcoll correctly with use locale 'nb_NO'" ); } +subtest "check that code is only called once by in_gb_locale" => sub { + + my $scalar_counter = 0; + my $out = mySociety::Locale::in_gb_locale { $scalar_counter++ }; + is $scalar_counter, 1, "code called once in scalar context"; + + my $list_counter = 0; + my @out = mySociety::Locale::in_gb_locale { $list_counter++ }; + is $list_counter, 1, "code called once in list context"; + +}; + done_testing(); |