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