Skip to content

Commit

Permalink
some print improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwes committed Jun 10, 2017
1 parent 1376231 commit 142cfe9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/gut/gut.gd
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ func _test_the_scripts():
#desired.
#-------------------------------------------------------------------------------
func p(text, level=0, indent=0):
var str_text = str(text)
var to_print = ""
var printing_test_name = false

Expand All @@ -890,7 +891,7 @@ func p(text, level=0, indent=0):
if(!_current_test.has_printed_name):
to_print = "* " + _current_test.name
_current_test.has_printed_name = true
printing_test_name = text == _current_test.name
printing_test_name = str_text == _current_test.name

if(!printing_test_name):
if(to_print != ""):
Expand All @@ -899,7 +900,8 @@ func p(text, level=0, indent=0):
var pad = ""
for i in range(0, indent):
pad += " "
to_print += pad + text
to_print += pad + str_text
to_print = to_print.replace("\n", "\n" + pad)

if(_should_print_to_console):
print(to_print)
Expand Down

0 comments on commit 142cfe9

Please sign in to comment.