Skip to content

Commit bd94108

Browse files
script_checking/PracticeTester: accept optional trailing semicolons i… (#1135)
--------- Co-authored-by: Nathan Lovato <12694995+NathanLovato@users.noreply.github.com>
1 parent 00cd403 commit bd94108

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

script_checking/PracticeTester.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func get_test_names() -> Array:
3232

3333
func run_tests() -> TestResult:
3434
var result := TestResult.new()
35-
35+
3636
_code_lines.clear()
3737
_prepare()
3838

@@ -52,7 +52,7 @@ func run_tests() -> TestResult:
5252

5353

5454
func _find_test_method_names() -> Dictionary:
55-
var output := {}
55+
var output := { }
5656

5757
var methods := []
5858
for method in get_method_list():
@@ -86,7 +86,7 @@ func matches_code_line(target_lines: Array) -> bool:
8686
_code_lines = _slice.current_text.split("\n")
8787

8888
for line in _code_lines:
89-
line = line.replace(" ", "").strip_edges()
89+
line = line.replace(" ", "").strip_edges().rstrip(";")
9090
for match_pattern in target_lines:
9191
if line.match(match_pattern):
9292
return true
@@ -107,7 +107,6 @@ func matches_code_line_regex(regex_patterns: Array) -> bool:
107107

108108
for line in _code_lines:
109109
for regex in regexes:
110-
var m = regex.search(line)
111110
if regex.search(line):
112111
return true
113112
return false
@@ -116,7 +115,8 @@ func matches_code_line_regex(regex_patterns: Array) -> bool:
116115
class TestResult:
117116
# List of tests passed successfully in the test suite.
118117
var passed_tests := []
119-
var errors := {}
118+
var errors := { }
119+
120120

121121
func is_success() -> bool:
122122
return errors.empty()

0 commit comments

Comments
 (0)