Skip to content

Commit

Permalink
WIP: Convert tests to print format instead of using the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MHendricks committed Mar 12, 2024
1 parent 9debe3e commit 3463443
Show file tree
Hide file tree
Showing 30 changed files with 277 additions and 394 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ repos:
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: ^(tests/find_files/)

- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand Down
2 changes: 1 addition & 1 deletion preditor/gui/find_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, find_text, case_sensitive=False, context=3):
self.case_sensitive = case_sensitive
self.context = context
self.find_text = find_text
self.margin_format = " {line_num: 4d}{match_indicator}"
self.margin_format = " {line_num: >4d}{match_indicator} "
self.match_count = 0

self.callback_matching = self.print_matching
Expand Down
22 changes: 0 additions & 22 deletions tests/find_files/re_greedy_False_0_True.html

This file was deleted.

12 changes: 12 additions & 0 deletions tests/find_files/re_greedy_False_0_True.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File: [First Group/First Tab](, 1,2, 0 "Open First Group/First Tab")
1: [Search term](, 1,2, 1 "Open First Group/First Tab at line number 1")
.
3: [search term](, 1,2, 3 "Open First Group/First Tab at line number 3")
.
6: [search term](, 1,2, 6 "Open First Group/First Tab at line number 6") at the start of the line
..
11: [search is in this line but the actual search term](, 1,2, 11 "Open First Group/First Tab at line number 11") is in the middle
..
17: This line has underscores around _[search term_ and "search term](, 1,2, 17 "Open First Group/First Tab at line number 17")" has double quotes
18: This line has the [search term in multiple times... search term](, 1,2, 18 "Open First Group/First Tab at line number 18")
19: [Search term the search term with the search term](, 1,2, 19 "Open First Group/First Tab at line number 19")
31 changes: 0 additions & 31 deletions tests/find_files/re_greedy_False_2_True.html

This file was deleted.

21 changes: 21 additions & 0 deletions tests/find_files/re_greedy_False_2_True.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# File: [First Group/First Tab](, 1,2, 0 "Open First Group/First Tab")
1: [Search term](, 1,2, 1 "Open First Group/First Tab at line number 1")
2 line 2
3: [search term](, 1,2, 3 "Open First Group/First Tab at line number 3")
4
5 line 5
6: [search term](, 1,2, 6 "Open First Group/First Tab at line number 6") at the start of the line
7 line 7
8 line 8
9 line 9
10 line 10
11: [search is in this line but the actual search term](, 1,2, 11 "Open First Group/First Tab at line number 11") is in the middle
12
13
..
15 line 15
16
17: This line has underscores around _[search term_ and "search term](, 1,2, 17 "Open First Group/First Tab at line number 17")" has double quotes
18: This line has the [search term in multiple times... search term](, 1,2, 18 "Open First Group/First Tab at line number 18")
19: [Search term the search term with the search term](, 1,2, 19 "Open First Group/First Tab at line number 19")
20 The "newline at end of file" is not printed due to str.splitlines.
31 changes: 0 additions & 31 deletions tests/find_files/re_greedy_True_2_True.html

This file was deleted.

21 changes: 21 additions & 0 deletions tests/find_files/re_greedy_True_2_True.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# File: [First Group/First Tab](, 1,2, 0 "Open First Group/First Tab")
1: [Search term](, 1,2, 1 "Open First Group/First Tab at line number 1")
2 line 2
3: [search term](, 1,2, 3 "Open First Group/First Tab at line number 3")
4
5 line 5
6: [search term](, 1,2, 6 "Open First Group/First Tab at line number 6") at the start of the line
7 line 7
8 line 8
9 line 9
10 line 10
11: [search is in this line but the actual search term](, 1,2, 11 "Open First Group/First Tab at line number 11") is in the middle
12
13
..
15 line 15
16
17: This line has underscores around _[search term_ and "search term](, 1,2, 17 "Open First Group/First Tab at line number 17")" has double quotes
18: This line has the [search term in multiple times... search term](, 1,2, 18 "Open First Group/First Tab at line number 18")
19: [Search term the search term with the search term](, 1,2, 19 "Open First Group/First Tab at line number 19")
20 The "newline at end of file" is not printed due to str.splitlines.
Loading

0 comments on commit 3463443

Please sign in to comment.