2009-01-03 18:52:47 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2009-10-09 18:54:13 +02:00
|
|
|
use Test::More tests => 11;
|
2009-01-03 18:52:47 +01:00
|
|
|
|
|
|
|
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);
|
2009-10-09 18:54:13 +02:00
|
|
|
|
|
|
|
ok(IkiWiki::yesno(undef) == 0);
|