response
[ikiwiki.git] / t / yesno.t
blob8770390a1075651caf9c6c4aeb46db3df338f0f8
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 11;
6 BEGIN { use_ok("IkiWiki"); }
8 # note: yesno always accepts English even if localized.
9 # So no need to bother setting locale to C.
11 ok(IkiWiki::yesno("yes") == 1);
12 ok(IkiWiki::yesno("Yes") == 1);
13 ok(IkiWiki::yesno("YES") == 1);
15 ok(IkiWiki::yesno("no") == 0);
16 ok(IkiWiki::yesno("No") == 0);
17 ok(IkiWiki::yesno("NO") == 0);
19 ok(IkiWiki::yesno("1") == 1);
20 ok(IkiWiki::yesno("0") == 0);
21 ok(IkiWiki::yesno("mooooooooooo") == 0);
23 ok(IkiWiki::yesno(undef) == 0);