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.

75 lines
888 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;
  7. chdir 'example';
  8. ok (my $w = App::WRT::new_from_file('wrt.json'), "Got WRT object.");
  9. my $testlines = <<'LINES';
  10. <textile>h1. Hello
  11. Some stuff.
  12. </textile>
  13. <markdown>
  14. La la la!
  15. </markdown>
  16. <freeverse>
  17. Dogs
  18. frolic in
  19. moonlight.
  20. </freeverse>
  21. <list>
  22. one
  23. two
  24. </list>
  25. <include>files/include_me</include>
  26. <include>files/include_me</include>
  27. LINES
  28. my $expectedlines = <<'LINES';
  29. <h1>Hello</h1>
  30. <p>Some stuff.</p>
  31. <p>La la la!</p>
  32. <p>Dogs<br />
  33. frolic in</p>
  34. <p>moonlight.</p>
  35. <ul>
  36. <li>one</li>
  37. <li>two</li>
  38. </ul>
  39. <p>This content included from elsewhere.</p>
  40. <p>This content included from elsewhere.</p>
  41. LINES
  42. my $result = $w->line_parse($testlines, undef);
  43. ok(
  44. $result eq $expectedlines,
  45. 'line_parse works'
  46. );
  47. if ($result ne $expectedlines) {
  48. diag($result);
  49. }
  50. 1;