Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions exercises/practice/acronym/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/all-your-base/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/allergies/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/alphametics/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/anagram/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/armstrong-numbers/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/atbash-cipher/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/baffling-birthdays/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/binary-search-tree/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/binary-search/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
18 changes: 9 additions & 9 deletions exercises/practice/bob/lib/test_runner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ class Runner:

return methods

func get_failed_test_message(actual, expected) -> String:
func get_failed_test_message(output) -> String:
"""
Generates a message for a failed test. If given values are strings,
this method will wrap them in single quotes, to distinguish from
other types, like integers (e.g. '3' vs 3).
Return the message to display for a failed test.

This method should be used if the actual and expected values for a
given test are different, or if they have different types.
`output` is a list containing `[actual, expected]` and an optional `message`.
If a message is provided, use it. Otherwise, format the actual and expected.
"""
var values = []
if len(output) == 3:
return output[2]

for value in [actual, expected]:
var values = []
for value in output:
var formatted_value = str(value)
if typeof(value) == TYPE_STRING:
formatted_value = "'{0}'".format([formatted_value])
Expand Down Expand Up @@ -370,7 +370,7 @@ class Runner:
if error_message.is_empty():
status = "pass" if passed else "fail"
error_message = (
null if passed else self.get_failed_test_message(actual, expected)
null if passed else self.get_failed_test_message(output)
)

var test_code = test_codes[method["name"]]
Expand Down
Loading
Loading