From 563a21c6ae61aec8eaca0f7677b4d86bd8829308 Mon Sep 17 00:00:00 2001 From: Zubrikhin Alexey Date: Sat, 18 Apr 2015 13:32:47 +1000 Subject: [PATCH] + t/parse-text-1.t --- t/parse-text-1.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 t/parse-text-1.t diff --git a/t/parse-text-1.t b/t/parse-text-1.t new file mode 100644 index 0000000..594f90b --- /dev/null +++ b/t/parse-text-1.t @@ -0,0 +1,33 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use utf8; + +use Test::More tests => 3; +use Text::Dokuwiki; + + +my $dw = Text::Dokuwiki->new; +isa_ok($dw, 'Text::Dokuwiki'); + + +my $text = "This is text with //inline **formatting**// rules [[http://site.com|and]] links."; +my $tree = [ $dw->_parse_text($text) ]; +is(ref $tree, 'ARRAY'); +is_deeply($tree, [ + 'This is text with ', + [span => {'font-style' =>'italic'}, + 'inline ', + [span => {'font-weight' => 'bold'}, + 'formatting', + ], + ], + ' rules ', + [a => {href => 'http://site.com'}, + 'and', + ], + ' links.', +]); + +exit 0;