Skip to content

Commit bd5e898

Browse files
committed
test: add failing test on capitalised description bug
#284 (comment)
1 parent b7646a0 commit bd5e898

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tagstudio/tests/core/test_search.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
id=2,
2626
filename="test_file3.png",
2727
path="test_folder",
28-
fields=[{"6": [1001]}, {"4": "description"}],
28+
fields=[{"6": [1001]}, {"4": "Foo description"}],
2929
)
3030
test_entry_four = Entry(
3131
id=3,
@@ -70,12 +70,14 @@
7070
"tag1 -description | description: desc",
7171
[{key_unbound: ["tag1"], key_empty: ["description"]}, {"description": "desc"}],
7272
),
73+
("; no author", [{key_unbound: ["no", "author"]}]),
74+
("description: Foo", [{"description": "foo"}])
7375
]
7476

7577
remap_cases: list[tuple] = [
7678
(test_entry_one, {"tags": [1000, 1001], "author": ["James"]}),
7779
(test_entry_two, {}),
78-
(test_entry_three, {"tags": [1001], "description": ["description"]}),
80+
(test_entry_three, {"tags": [1001], "description": ["Foo description"]}),
7981
(test_entry_four, {"author": ["Victor"], "description": ["description"]}),
8082
(test_entry_five, {"author": ["Victor", "James"]}),
8183
]
@@ -154,6 +156,12 @@
154156
],
155157
)
156158

159+
filter_case_six: tuple = (
160+
[{"description": "foo"}],
161+
SearchMode.OR,
162+
[(ItemType.ENTRY, 2), (ItemType.ENTRY, 5)]
163+
)
164+
157165
negative_filter_case_one: tuple = (
158166
[{key_empty: "description"}],
159167
SearchMode.OR,
@@ -191,6 +199,7 @@
191199
filter_case_three,
192200
filter_case_four,
193201
filter_case_five,
202+
filter_case_six,
194203
negative_filter_case_one,
195204
negative_filter_case_two,
196205
negative_filter_case_three,

0 commit comments

Comments
 (0)