@@ -26,6 +26,8 @@ import inheritance_task_listitem from './__test_data__/inheritance_task_listitem
26
26
import inheritance_task_listitem_mixed_grandchildren from './__test_data__/inheritance_task_listitem_mixed_grandchildren.json' ;
27
27
import inheritance_task_listitem_task from './__test_data__/inheritance_task_listitem_task.json' ;
28
28
import inheritance_task_mixed_children from './__test_data__/inheritance_task_mixed_children.json' ;
29
+ import numbered_list_items_with_paren from './__test_data__/numbered_list_items_with_paren.json' ;
30
+ import numbered_list_items_standard from './__test_data__/numbered_list_items_standard.json' ;
29
31
import one_task from './__test_data__/one_task.json' ;
30
32
import callouts_nested_issue_2890_labelled from './__test_data__/callouts_nested_issue_2890_labelled.json' ;
31
33
import callout from './__test_data__/callout.json' ;
@@ -124,6 +126,38 @@ describe('cache', () => {
124
126
testRootAndChildren ( sibling2 , [ ] ) ;
125
127
} ) ;
126
128
129
+ it ( 'should read numbered list items with dot' , ( ) => {
130
+ const data = numbered_list_items_standard ;
131
+ const tasks = readTasksFromSimulatedFile ( data ) ;
132
+ expect ( data . fileContents ) . toMatchInlineSnapshot ( `
133
+ "# numbered_list_items_standard
134
+
135
+ 1. [ ] #task Task 1 in 'numbered_list_items_standard'
136
+ 1. Sub-item 1
137
+ 2. [ ] #task Task 2 in 'numbered_list_items_standard'
138
+ 2. Sub-item 2
139
+ "
140
+ ` ) ;
141
+ expect ( tasks . length ) . toEqual ( 2 ) ;
142
+ } ) ;
143
+
144
+ it . failing ( 'should read numbered list items with closing parenthesis' , ( ) => {
145
+ // See https://github.com/obsidian-tasks-group/obsidian-tasks/issues/3401
146
+ // "Unexpected failure to create a list item from line" warning when parsing "1)" style numbered list
147
+ const data = numbered_list_items_with_paren ;
148
+ const tasks = readTasksFromSimulatedFile ( data ) ;
149
+ expect ( data . fileContents ) . toMatchInlineSnapshot ( `
150
+ "# numbered_list_items_with_paren
151
+
152
+ 1) [ ] #task Task 1 in 'numbered_list_items_with_paren'
153
+ 1) Sub-item 1
154
+ 2) [ ] #task Task w in 'numbered_list_items_with_paren'
155
+ 1) Sub-item 2
156
+ "
157
+ ` ) ;
158
+ expect ( tasks . length ) . toEqual ( 2 ) ;
159
+ } ) ;
160
+
127
161
it ( 'should read one parent and one child task' , ( ) => {
128
162
const tasks = readTasksFromSimulatedFile ( inheritance_1parent1child ) ;
129
163
expect ( inheritance_1parent1child . fileContents ) . toMatchInlineSnapshot ( `
0 commit comments