Skip to content

Commit

Permalink
test: more color overwriting coverage
Browse files Browse the repository at this point in the history
A test covering overwriting a specific color via
Log.set_color_scheme(scheme)
  • Loading branch information
russmatney committed Apr 14, 2024
1 parent f62b9e7 commit 62d535f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/log_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,19 @@ func test_color_overwriting():
# does not clear other colors
val = Log.to_pretty(1, {color_scheme={TYPE_NIL: "red"}})
assert_str(val).is_equal("[color=green]1[/color]")

func test_color_scheme_overwriting():
var val = Log.to_pretty(null)
assert_str(val).is_equal("[color=pink]<null>[/color]")

Log.set_color_scheme({TYPE_NIL: "red"})

val = Log.to_pretty(null)
assert_str(val).is_equal("[color=red]<null>[/color]")

# does not clear other colors
val = Log.to_pretty(1)
assert_str(val).is_equal("[color=green]1[/color]")

# reset colors
Log.set_colors_termsafe()

0 comments on commit 62d535f

Please sign in to comment.