8 use lib $Bin, "$Bin/t";
15 name => 'non-setting (missing +)',
16 filter_elements => 'Org::Element::Setting',
24 name => 'non-setting (not on first column)',
25 filter_elements => 'Org::Element::Setting',
33 name => 'syntax error (missing colon, becomes comment)',
34 filter_elements => 'Org::Element::Setting',
43 name => 'unknown setting',
44 filter_elements => 'Org::Element::Setting',
52 name => 'FILETAGS: argument syntax error',
53 filter_elements => 'Org::Element::Setting',
61 name => 'FILETAGS: basic tests',
62 filter_elements => 'Org::Element::Setting',
64 #+FILETAGS: :tag1:tag2:tag3:
67 test_after_parse => sub {
69 my $doc = $args{result};
70 my $elems = $args{elements};
71 is($elems->[0]->name, "FILETAGS", "name");
72 is($elems->[0]->args->[0], ":tag1:tag2:tag3:", "args[0]");
77 name => 'PRIORITIES: basic tests',
78 filter_elements => 'Org::Element::Setting',
80 #+PRIORITIES: A1 A2 B1 B2 C1 C2
83 test_after_parse => sub {
85 my $doc = $args{result};
86 my $elems = $args{elements};
87 is($elems->[0]->name, "PRIORITIES", "name");
88 is_deeply($elems->[0]->args, [qw/A1 A2 B1 B2 C1 C2/],
90 is_deeply($doc->priorities, [qw/A1 A2 B1 B2 C1 C2/],
91 "document's priorities attribute");
96 name => 'DRAWERS: basic tests',
97 filter_elements => 'Org::Element::Setting',
102 test_after_parse => sub {
104 my $doc = $args{result};
105 my $elems = $args{elements};
106 is($elems->[0]->name, "DRAWERS", "name");
107 ok("D1" ~~ @{$doc->drawer_names},
108 "D1 added to list of known drawers");
109 ok("D2" ~~ @{$doc->drawer_names},
110 "D2 added to list of known drawers");
111 ok("CLOCK" ~~ @{$doc->drawer_names},
112 "default drawers still known");
117 name => 'indentable_elements (not indentable)',
118 filter_elements => 'Org::Element::Setting',
126 name => 'indentable_elements (not indentable, test text)',
127 filter_elements => 'Org::Element::Text',
133 test_after_parse => sub {
135 my $elems = $args{elements};
136 is($elems->[0]->as_string, " #+TODO: D E | F\n", "text");
141 name => 'indentable_elements (indentable)',
142 filter_elements => 'Org::Element::Setting',
148 test_after_parse => sub {
150 my $elems = $args{elements};
151 is($elems->[1]->indent, " ", "indent attribute");