Skip to content

Commit ff518cf

Browse files
tests(lesson-12): require angular_speed * delta in rotate() (#1138)
-------- Co-authored-by: Nathan Lovato <12694995+NathanLovato@users.noreply.github.com>
1 parent bd94108 commit ff518cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

course/lesson-12-using-variables/clarify/TestClarifyCode.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func test_angular_speed_has_value_of_4() -> String:
3030

3131
func test_angular_speed_is_used_in_process_function() -> String:
3232
var regex = RegEx.new()
33-
regex.compile("rotate\\(\\s*angular_speed")
33+
regex.compile("rotate\\([^)]*(?:angular_speed\\s*\\*\\s*delta|delta\\s*\\*\\s*angular_speed)")
3434
var result = regex.search(_slice.current_text)
3535
if not result:
36-
return tr("The rotate() function doesn't seem to use the angular_speed variable.")
36+
return tr("The rotate() call must multiply angular_speed by delta (e.g. rotate(angular_speed * delta)).")
3737
return ""

course/lesson-12-using-variables/fixing_error/TestFixingError.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func test_angular_speed_has_value_of_4() -> String:
3030

3131
func test_angular_speed_is_used_in_process_function() -> String:
3232
var regex = RegEx.new()
33-
regex.compile("rotate\\(\\s*angular_speed")
33+
regex.compile("rotate\\([^)]*(?:angular_speed\\s*\\*\\s*delta|delta\\s*\\*\\s*angular_speed)")
3434
var result = regex.search(_slice.current_text)
3535
if not result:
36-
return tr("The rotate() function doesn't seem to use the angular_speed variable.")
36+
return tr("The rotate() call must multiply angular_speed by delta (e.g. rotate(angular_speed * delta)).")
3737
return ""
3838

3939

0 commit comments

Comments
 (0)