aboutsummaryrefslogtreecommitdiff
path: root/t/yesno.t
blob: 60a8c071d6153739639cb6c50322fd2aaea082c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 10;

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);