Skip to content

Commit 9cc77a0

Browse files
committed
test: Add test data for #3401 - parsing 1) as list item
1 parent ea3207e commit 9cc77a0

File tree

6 files changed

+316
-0
lines changed

6 files changed

+316
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# numbered_list_items_standard
2+
3+
1. [ ] #task Task 1 in 'numbered_list_items_standard'
4+
1. Sub-item 1
5+
2. [ ] #task Task 2 in 'numbered_list_items_standard'
6+
2. Sub-item 2
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# numbered_list_items_with_paren
2+
3+
1) [ ] #task Task 1 in 'numbered_list_items_with_paren'
4+
1) Sub-item 1
5+
2) [ ] #task Task w in 'numbered_list_items_with_paren'
6+
1) Sub-item 2

tests/Obsidian/AllCacheSampleData.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import multiple_headings from './__test_data__/multiple_headings.json';
5353
import no_heading from './__test_data__/no_heading.json';
5454
import no_yaml from './__test_data__/no_yaml.json';
5555
import non_tasks from './__test_data__/non_tasks.json';
56+
import numbered_list_items_standard from './__test_data__/numbered_list_items_standard.json';
57+
import numbered_list_items_with_paren from './__test_data__/numbered_list_items_with_paren.json';
5658
import one_task from './__test_data__/one_task.json';
5759
import query_file_defaults_all_options_false from './__test_data__/query_file_defaults_all_options_false.json';
5860
import query_file_defaults_all_options_null from './__test_data__/query_file_defaults_all_options_null.json';
@@ -132,6 +134,8 @@ export function allCacheSampleData() {
132134
no_heading,
133135
no_yaml,
134136
non_tasks,
137+
numbered_list_items_standard,
138+
numbered_list_items_with_paren,
135139
one_task,
136140
query_file_defaults_all_options_false,
137141
query_file_defaults_all_options_null,

tests/Obsidian/Cache.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ describe('all mock files', () => {
799799
const files_without_tasks = [
800800
'Test Data/docs_sample_for_explain_query_file_defaults.md',
801801
'Test Data/non_tasks.md',
802+
'Test Data/numbered_list_items_with_paren.md',
802803
];
803804
if (files_without_tasks.includes(path)) {
804805
expect(tasks.length).toEqual(0);
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"cachedMetadata": {
3+
"headings": [
4+
{
5+
"heading": "numbered_list_items_standard",
6+
"level": 1,
7+
"position": {
8+
"end": {
9+
"col": 30,
10+
"line": 0,
11+
"offset": 30
12+
},
13+
"start": {
14+
"col": 0,
15+
"line": 0,
16+
"offset": 0
17+
}
18+
}
19+
}
20+
],
21+
"listItems": [
22+
{
23+
"parent": -2,
24+
"position": {
25+
"end": {
26+
"col": 53,
27+
"line": 2,
28+
"offset": 85
29+
},
30+
"start": {
31+
"col": 0,
32+
"line": 2,
33+
"offset": 32
34+
}
35+
},
36+
"task": " "
37+
},
38+
{
39+
"parent": 2,
40+
"position": {
41+
"end": {
42+
"col": 17,
43+
"line": 3,
44+
"offset": 103
45+
},
46+
"start": {
47+
"col": 4,
48+
"line": 3,
49+
"offset": 90
50+
}
51+
}
52+
},
53+
{
54+
"parent": -2,
55+
"position": {
56+
"end": {
57+
"col": 17,
58+
"line": 5,
59+
"offset": 175
60+
},
61+
"start": {
62+
"col": 0,
63+
"line": 4,
64+
"offset": 104
65+
}
66+
},
67+
"task": " "
68+
}
69+
],
70+
"sections": [
71+
{
72+
"position": {
73+
"end": {
74+
"col": 30,
75+
"line": 0,
76+
"offset": 30
77+
},
78+
"start": {
79+
"col": 0,
80+
"line": 0,
81+
"offset": 0
82+
}
83+
},
84+
"type": "heading"
85+
},
86+
{
87+
"position": {
88+
"end": {
89+
"col": 17,
90+
"line": 5,
91+
"offset": 175
92+
},
93+
"start": {
94+
"col": 0,
95+
"line": 2,
96+
"offset": 32
97+
}
98+
},
99+
"type": "list"
100+
}
101+
],
102+
"tags": [
103+
{
104+
"position": {
105+
"end": {
106+
"col": 12,
107+
"line": 2,
108+
"offset": 44
109+
},
110+
"start": {
111+
"col": 7,
112+
"line": 2,
113+
"offset": 39
114+
}
115+
},
116+
"tag": "#task"
117+
},
118+
{
119+
"position": {
120+
"end": {
121+
"col": 12,
122+
"line": 4,
123+
"offset": 116
124+
},
125+
"start": {
126+
"col": 7,
127+
"line": 4,
128+
"offset": 111
129+
}
130+
},
131+
"tag": "#task"
132+
}
133+
]
134+
},
135+
"fileContents": "# numbered_list_items_standard\n\n1. [ ] #task Task 1 in 'numbered_list_items_standard'\n 1. Sub-item 1\n2. [ ] #task Task 2 in 'numbered_list_items_standard'\n 2. Sub-item 2\n",
136+
"filePath": "Test Data/numbered_list_items_standard.md",
137+
"getAllTags": [
138+
"#task",
139+
"#task"
140+
],
141+
"parseFrontMatterTags": null
142+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"cachedMetadata": {
3+
"headings": [
4+
{
5+
"heading": "numbered_list_items_with_paren",
6+
"level": 1,
7+
"position": {
8+
"end": {
9+
"col": 32,
10+
"line": 0,
11+
"offset": 32
12+
},
13+
"start": {
14+
"col": 0,
15+
"line": 0,
16+
"offset": 0
17+
}
18+
}
19+
}
20+
],
21+
"listItems": [
22+
{
23+
"parent": -2,
24+
"position": {
25+
"end": {
26+
"col": 55,
27+
"line": 2,
28+
"offset": 89
29+
},
30+
"start": {
31+
"col": 0,
32+
"line": 2,
33+
"offset": 34
34+
}
35+
},
36+
"task": " "
37+
},
38+
{
39+
"parent": 2,
40+
"position": {
41+
"end": {
42+
"col": 17,
43+
"line": 3,
44+
"offset": 107
45+
},
46+
"start": {
47+
"col": 3,
48+
"line": 3,
49+
"offset": 93
50+
}
51+
}
52+
},
53+
{
54+
"parent": -2,
55+
"position": {
56+
"end": {
57+
"col": 55,
58+
"line": 4,
59+
"offset": 163
60+
},
61+
"start": {
62+
"col": 0,
63+
"line": 4,
64+
"offset": 108
65+
}
66+
},
67+
"task": " "
68+
},
69+
{
70+
"parent": 4,
71+
"position": {
72+
"end": {
73+
"col": 17,
74+
"line": 5,
75+
"offset": 181
76+
},
77+
"start": {
78+
"col": 3,
79+
"line": 5,
80+
"offset": 167
81+
}
82+
}
83+
}
84+
],
85+
"sections": [
86+
{
87+
"position": {
88+
"end": {
89+
"col": 32,
90+
"line": 0,
91+
"offset": 32
92+
},
93+
"start": {
94+
"col": 0,
95+
"line": 0,
96+
"offset": 0
97+
}
98+
},
99+
"type": "heading"
100+
},
101+
{
102+
"position": {
103+
"end": {
104+
"col": 17,
105+
"line": 5,
106+
"offset": 181
107+
},
108+
"start": {
109+
"col": 0,
110+
"line": 2,
111+
"offset": 34
112+
}
113+
},
114+
"type": "list"
115+
}
116+
],
117+
"tags": [
118+
{
119+
"position": {
120+
"end": {
121+
"col": 12,
122+
"line": 2,
123+
"offset": 46
124+
},
125+
"start": {
126+
"col": 7,
127+
"line": 2,
128+
"offset": 41
129+
}
130+
},
131+
"tag": "#task"
132+
},
133+
{
134+
"position": {
135+
"end": {
136+
"col": 12,
137+
"line": 4,
138+
"offset": 120
139+
},
140+
"start": {
141+
"col": 7,
142+
"line": 4,
143+
"offset": 115
144+
}
145+
},
146+
"tag": "#task"
147+
}
148+
]
149+
},
150+
"fileContents": "# numbered_list_items_with_paren\n\n1) [ ] #task Task 1 in 'numbered_list_items_with_paren'\n 1) Sub-item 1\n2) [ ] #task Task w in 'numbered_list_items_with_paren'\n 1) Sub-item 2\n",
151+
"filePath": "Test Data/numbered_list_items_with_paren.md",
152+
"getAllTags": [
153+
"#task",
154+
"#task"
155+
],
156+
"parseFrontMatterTags": null
157+
}

0 commit comments

Comments
 (0)