/[suikacvs]/messaging/manakai/t/markup-swcfg20-parser.t
Suika

Contents of /messaging/manakai/t/markup-swcfg20-parser.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Nov 15 07:55:26 2003 UTC (21 years ago) by wakaba
Branch: MAIN
CVS Tags: before-dis2-200411, manakai-release-0-3-2, manakai-release-0-3-1, manakai-release-0-4-0, manakai-200612, HEAD
Branch point for: experimental-xml-parser-200401
File MIME type: application/x-troff
Moved from SuikaWiki

1 #!/usr/bin/perl
2 use strict;
3 require Message::Markup::SuikaWikiConfig20::Parser;
4
5 my $cfg = Message::Markup::SuikaWikiConfig20::Parser->new;
6
7 require Test::Simple;
8 my $t = q(foo: aiueo
9 #comment
10 #(multiple lines)
11
12 #comment
13 #(multiple lines)
14 foo: val
15 foo:
16 value
17 with multiple
18 \ lines
19 multiple lines: val
20 foo:
21 value
22 with multiple
23 \@ lines
24 \\\\ escaped
25 \
26 name:
27 @@: val
28 @foo: bar
29 @foo: 0
30 @\@: \@ foo
31 @foo:
32 something multi
33 \
34 \ line
35 @foo:
36 @@@:
37 something\
38 \ multi
39 \
40 \ line
41 @@foo: bar
42 @@foo: 0
43 @@\@: \@ foo
44 @@foo:
45 something\
46 \ multi
47 \
48 \ line
49 @@foolist[list]:
50 foo
51 bar
52 \#baz
53 bar
54 ###COMMENT##
55 );
56
57 my $parsed = $cfg->parse_text ($t);
58
59 my @s = split /\n/, $parsed->stringify;
60 my @t = split /\n/, $t;
61
62 Test::Simple->import (tests => scalar @t);
63 for (0..($#t > $#s ? $#t : $#s)) {
64 ok ($s[$_] eq $t[$_], "Line $_ : '$s[$_]' '$t[$_]'");
65 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24