Almost-minimal filesystem based blog.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
535 B

  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use lib 'lib';
  5. use Test::More tests => 2;
  6. use App::WRT::HTML qw(:all);
  7. my $a_tag = a('hi', {href => 'https://example.com/', title => 'example'});
  8. diag($a_tag);
  9. ok(
  10. $a_tag eq '<a href="https://example.com/" title="example">hi</a>',
  11. 'got a tag with attributes'
  12. );
  13. my $small_tag = small('text', {title => '<thing with angle brackets>'});
  14. diag($small_tag);
  15. ok(
  16. $small_tag eq '<small title="&lt;thing with angle brackets&gt;">text</small>',
  17. 'got a tag with escaped attributes'
  18. );