Browse Source

* renamed module

master
Zubrikhin Alexey 10 years ago
parent
commit
a18881f769
  1. 4
      lib/Text/Dokuwiki/Parser.pm
  2. 6
      t/parser-include.t
  3. 6
      t/parser-lists.t
  4. 6
      t/parser-table.t
  5. 6
      t/parser-text-1.t

4
lib/Text/Dokuwiki.pm → lib/Text/Dokuwiki/Parser.pm

@ -1,12 +1,10 @@
package Text::Dokuwiki; package Text::Dokuwiki::Parser;
use strict; use strict;
use warnings; use warnings;
use feature qw/ switch /; use feature qw/ switch /;
use utf8; use utf8;
use Data::Dumper;
sub new { sub new {
my ($class) = @_; my ($class) = @_;
my $self = {}; my $self = {};

6
t/parse-include.t → t/parser-include.t

@ -5,10 +5,10 @@ use warnings;
use utf8; use utf8;
use Test::More tests => 8; use Test::More tests => 8;
use Text::Dokuwiki; use Text::Dokuwiki::Parser;
my $dw = Text::Dokuwiki->new; my $dw = Text::Dokuwiki::Parser->new;
isa_ok($dw, 'Text::Dokuwiki'); isa_ok($dw, 'Text::Dokuwiki::Parser');
my $elem = $dw->_parse_include('{{image.png}}'); my $elem = $dw->_parse_include('{{image.png}}');
is(ref $elem, 'ARRAY'); is(ref $elem, 'ARRAY');

6
t/parse-lists.t → t/parser-lists.t

@ -5,7 +5,7 @@ use warnings;
use utf8; use utf8;
use Test::More tests => 3; use Test::More tests => 3;
use Text::Dokuwiki; use Text::Dokuwiki::Parser;
my @lines = split /\n/, <<EOF; my @lines = split /\n/, <<EOF;
* level1 item1 * level1 item1
@ -18,8 +18,8 @@ my @lines = split /\n/, <<EOF;
- level1 of 2nd list, item2 - level1 of 2nd list, item2
EOF EOF
my $dw = Text::Dokuwiki->new; my $dw = Text::Dokuwiki::Parser->new;
isa_ok($dw, 'Text::Dokuwiki'); isa_ok($dw, 'Text::Dokuwiki::Parser');
my @lists = $dw->_parse_list([ @lines ]); my @lists = $dw->_parse_list([ @lines ]);
is (scalar @lists, 2); is (scalar @lists, 2);

6
t/parse-table.t → t/parser-table.t

@ -5,7 +5,7 @@ use warnings;
use utf8; use utf8;
use Test::More tests => 3; use Test::More tests => 3;
use Text::Dokuwiki; use Text::Dokuwiki::Parser;
my @lines = split /\n/, <<EOF; my @lines = split /\n/, <<EOF;
| table ^ head1 ^ head2 ^ sum | | table ^ head1 ^ head2 ^ sum |
@ -15,8 +15,8 @@ my @lines = split /\n/, <<EOF;
^ data4 | 4-1 | 4-2 | ::: | ^ data4 | 4-1 | 4-2 | ::: |
EOF EOF
my $dw = Text::Dokuwiki->new; my $dw = Text::Dokuwiki::Parser->new;
isa_ok($dw, 'Text::Dokuwiki'); isa_ok($dw, 'Text::Dokuwiki::Parser');
my $tree = $dw->_parse_table([ @lines ]); my $tree = $dw->_parse_table([ @lines ]);
is(ref $tree, 'ARRAY'); is(ref $tree, 'ARRAY');

6
t/parse-text-1.t → t/parser-text-1.t

@ -5,10 +5,10 @@ use warnings;
use utf8; use utf8;
use Test::More tests => 3; use Test::More tests => 3;
use Text::Dokuwiki; use Text::Dokuwiki::Parser;
my $dw = Text::Dokuwiki->new; my $dw = Text::Dokuwiki::Parser->new;
isa_ok($dw, 'Text::Dokuwiki'); isa_ok($dw, 'Text::Dokuwiki::Parser');
my $text = "This is text with //inline **formatting**// rules [[http://site.com|and]] links."; my $text = "This is text with //inline **formatting**// rules [[http://site.com|and]] links.";
my $tree = [ $dw->_parse_text($text) ]; my $tree = [ $dw->_parse_text($text) ];
Loading…
Cancel
Save