summaryrefslogtreecommitdiff
path: root/t/beautify_urlpath.t
blob: 94b923d3bd2fc9ad1dbc81588249272c0f509ff3 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use Test::More tests => 8;
  5. BEGIN { use_ok("IkiWiki"); }
  6. $IkiWiki::config{usedirs} = 1;
  7. $IkiWiki::config{htmlext} = "HTML";
  8. is(IkiWiki::beautify_urlpath("foo/bar"), "./foo/bar");
  9. is(IkiWiki::beautify_urlpath("../badger"), "../badger");
  10. is(IkiWiki::beautify_urlpath("./bleh"), "./bleh");
  11. is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/");
  12. is(IkiWiki::beautify_urlpath("index.HTML"), "./");
  13. is(IkiWiki::beautify_urlpath("../index.HTML"), "../");
  14. $IkiWiki::config{usedirs} = 0;
  15. is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/index.HTML");