-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for local editor filter_by_name_pattern. (#42)
* Add unit tests for local editor filter_by_name_pattern. * Add more test cases. * fix name
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[C:/Users/user/AppData/Roaming/Godot/app_userdata/Godots/versions/Godot_v4_1_1-stable_win64_exe/Godot_v4.1.1-stable_win64.exe] | ||
|
||
name="Godot v4.1.1 stable" | ||
favorite=false | ||
|
||
[C:/Users/user/AppData/Roaming/Godot/app_userdata/Godots/versions/Godot_v4_1_2-stable_win64_exe/Godot_v4.1.2-stable_win64.exe] | ||
|
||
name="Godot v4.1.2 stable" | ||
favorite=false | ||
|
||
[C:/Users/user/AppData/Roaming/Godot/app_userdata/Godots/versions/Godot_v4_1-stable_win64_exe/Godot_v4.1-stable_win64.exe] | ||
|
||
name="Godot v4.1 stable" | ||
favorite=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class_name LocalEditorTests | ||
extends GdUnitTestSuite | ||
|
||
const config_path = "res://tests/cases/services/assets/editors.cfg" | ||
|
||
func test_filter_by_name_pattern(name: String, expected: int, test_parameters:= [ | ||
["4.1", 3], | ||
["4.1s", 1], | ||
["4.1 s", 1], | ||
[" 4.1 s", 1], | ||
["4.1 StAble", 1], | ||
["invalid", 0], | ||
]): | ||
var editors = LocalEditors.List.new(config_path) | ||
editors.load() | ||
var result = editors.filter_by_name_pattern(name) | ||
assert(result.size() == expected) |