summaryrefslogtreecommitdiff
path: root/t/yesno.t
blob: 60a8c071d6153739639cb6c50322fd2aaea082c0 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use Test::More tests => 10;
  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);