Indent every script with tabs, like the Godot editor does
This commit is contained in:
1 parent
8c1987807c
commit
bad4b3ad8b
35 files changed
+1653
-1653
No files matched your search
@@ -7,62 +7,62 @@ var _hide_for_seconds: float
|
||||
|
||||
|
||||
func before_test() -> void:
|
||||
_music_player = auto_free(MusicPlayer.new())
|
||||
_hide_beginning = Settings.hide_beginning
|
||||
_hide_length = Settings.hide_length
|
||||
_hide_for_seconds = Settings.hide_for_seconds
|
||||
Settings.hide_beginning = false
|
||||
Settings.hide_length = false
|
||||
Settings.hide_for_seconds = 5.0
|
||||
_music_player = auto_free(MusicPlayer.new())
|
||||
_hide_beginning = Settings.hide_beginning
|
||||
_hide_length = Settings.hide_length
|
||||
_hide_for_seconds = Settings.hide_for_seconds
|
||||
Settings.hide_beginning = false
|
||||
Settings.hide_length = false
|
||||
Settings.hide_for_seconds = 5.0
|
||||
|
||||
|
||||
func after_test() -> void:
|
||||
Settings.hide_beginning = _hide_beginning
|
||||
Settings.hide_length = _hide_length
|
||||
Settings.hide_for_seconds = _hide_for_seconds
|
||||
Settings.hide_beginning = _hide_beginning
|
||||
Settings.hide_length = _hide_length
|
||||
Settings.hide_for_seconds = _hide_for_seconds
|
||||
|
||||
|
||||
func test_format_time() -> void:
|
||||
assert_str(_music_player.format_time(0.0)).is_equal("00:00")
|
||||
assert_str(_music_player.format_time(65.0)).is_equal("01:05")
|
||||
assert_str(_music_player.format_time(3661.0)).is_equal("61:01")
|
||||
assert_str(_music_player.format_time(0.0)).is_equal("00:00")
|
||||
assert_str(_music_player.format_time(65.0)).is_equal("01:05")
|
||||
assert_str(_music_player.format_time(3661.0)).is_equal("61:01")
|
||||
|
||||
|
||||
func test_format_time_rounds_up_into_next_minute() -> void:
|
||||
assert_str(_music_player.format_time(59.6)).is_equal("01:00")
|
||||
assert_str(_music_player.format_time(59.6)).is_equal("01:00")
|
||||
|
||||
|
||||
func test_format_text_shows_position_and_length() -> void:
|
||||
assert_str(_music_player.format_text(10.0, 100.0)).is_equal("00:10 / 01:40")
|
||||
assert_str(_music_player.format_text(10.0, 100.0)).is_equal("00:10 / 01:40")
|
||||
|
||||
|
||||
func test_format_text_hides_length() -> void:
|
||||
Settings.hide_length = true
|
||||
Settings.hide_length = true
|
||||
|
||||
assert_str(_music_player.format_text(10.0, 100.0)).is_equal("00:10 / ??:??")
|
||||
assert_str(_music_player.format_text(10.0, 100.0)).is_equal("00:10 / ??:??")
|
||||
|
||||
|
||||
func test_format_text_hides_position_at_start() -> void:
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_beginning = true
|
||||
|
||||
assert_str(_music_player.format_text(3.0, 100.0)).is_equal("??:?? / 01:40")
|
||||
assert_str(_music_player.format_text(3.0, 100.0)).is_equal("??:?? / 01:40")
|
||||
|
||||
|
||||
func test_format_text_shows_position_after_hidden_start() -> void:
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_beginning = true
|
||||
|
||||
assert_str(_music_player.format_text(5.0, 100.0)).is_equal("00:05 / 01:40")
|
||||
assert_str(_music_player.format_text(5.0, 100.0)).is_equal("00:05 / 01:40")
|
||||
|
||||
|
||||
func test_format_text_hides_everything_at_start() -> void:
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_length = true
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_length = true
|
||||
|
||||
assert_str(_music_player.format_text(3.0, 100.0)).is_equal("??:?? / ??:??")
|
||||
assert_str(_music_player.format_text(3.0, 100.0)).is_equal("??:?? / ??:??")
|
||||
|
||||
|
||||
func test_format_text_keeps_length_hidden_after_hidden_start() -> void:
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_length = true
|
||||
Settings.hide_beginning = true
|
||||
Settings.hide_length = true
|
||||
|
||||
assert_str(_music_player.format_text(5.0, 100.0)).is_equal("00:05 / ??:??")
|
||||
assert_str(_music_player.format_text(5.0, 100.0)).is_equal("00:05 / ??:??")
|
||||
Reference in new issue
Block a user