blob: 8770390a1075651caf9c6c4aeb46db3df338f0f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 11;
BEGIN { use_ok("IkiWiki"); }
# note: yesno always accepts English even if localized.
# So no need to bother setting locale to C.
ok(IkiWiki::yesno("yes") == 1);
ok(IkiWiki::yesno("Yes") == 1);
ok(IkiWiki::yesno("YES") == 1);
ok(IkiWiki::yesno("no") == 0);
ok(IkiWiki::yesno("No") == 0);
ok(IkiWiki::yesno("NO") == 0);
ok(IkiWiki::yesno("1") == 1);
ok(IkiWiki::yesno("0") == 0);
ok(IkiWiki::yesno("mooooooooooo") == 0);
ok(IkiWiki::yesno(undef) == 0);
|