Skip to content

Commit

Permalink
fix: restore current tests after color changes
Browse files Browse the repository at this point in the history
Ideally these wouldn't be so brittle - maybe swapping in color palettes
will help.
  • Loading branch information
russmatney committed Mar 27, 2024
1 parent b7241fa commit e8d7b05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/log_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ extends GdUnitTestSuite

func test_log_params():
var val = Log.to_printable([1, 2, 3])
assert_that(val).is_equal("1 2 3")
assert_that(val).is_equal(
"[color=green]1[/color] [color=green]2[/color] [color=green]3[/color]")

func test_log_array():
var val = Log.to_printable([[1, 2, 3]])
assert_that(val).is_equal("[color=red][ [/color]1[color=red], [/color]2[color=red], [/color]3[color=red] ][/color]")
assert_that(val).is_equal(
"[color=red][ [/color][color=green]1[/color][color=red], [/color][color=green]2[/color][color=red], [/color][color=green]3[/color][color=red] ][/color]")

func test_log_vector():
var val = Log.to_printable([Vector2(1, 2)])
Expand All @@ -17,7 +19,7 @@ func test_log_vector():
func test_log_dictionary():
var val = Log.to_printable([{some="val", another=2}])
assert_that(val).is_equal(
"[color=red]{ [/color][color=magenta]\"some\"[/color]: [color=pink]val[/color][color=red], [/color][color=magenta]\"another\"[/color]: 2[color=red] }[/color]")
"[color=red]{ [/color][color=magenta]\"some\"[/color]: [color=pink]val[/color][color=red], [/color][color=magenta]\"another\"[/color]: [color=green]2[/color][color=red] }[/color]")

func test_log_strings_and_string_names():
var val = Log.to_printable(["Special"])
Expand All @@ -38,5 +40,5 @@ func test_custom_to_printable():
var val = Log.to_printable([obj])
var id = obj.get_instance_id()
assert_that(val).is_equal(
"[color=red]{ [/color][color=magenta]\"val\"[/color]: ([color=purple]1[/color],[color=purple]2[/color])[color=red], [/color][color=magenta]\"id\"[/color]: %s[color=red] }[/color]" \
"[color=red]{ [/color][color=magenta]\"val\"[/color]: ([color=purple]1[/color],[color=purple]2[/color])[color=red], [/color][color=magenta]\"id\"[/color]: [color=green]%s[/color][color=red] }[/color]" \
% str(id))

0 comments on commit e8d7b05

Please sign in to comment.