mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2025-06-30 23:10:21 +02:00
skinlist: Allow textures containing '-' characters
Fixes issue #110 Thanks to Bastrabun for the code suggestion
This commit is contained in:
@ -9,12 +9,14 @@ local function run_unittest()
|
||||
|
||||
-- -----
|
||||
-- `.`: Simple register + retrieve operations
|
||||
skins.register_skin(PATH, "player.DotSep.png")
|
||||
skins.register_skin(PATH, "player._DotSep_666_.1.png")
|
||||
assert(skins.register_skin(PATH, "player.DotSep.png"))
|
||||
assert(skins.register_skin(PATH, "player._DotSep_666_.1.png"))
|
||||
assert(skins.register_skin(PATH, "character._DotSep_With-Dash-.png"))
|
||||
|
||||
assert(get_skin("player.DotSep"))
|
||||
assert(get_skin("player._DotSep_666_.1"))
|
||||
assert(get_skin("player.DotSep.1") == nil)
|
||||
assert(get_skin("character._DotSep_With-Dash-"))
|
||||
|
||||
-- -----
|
||||
-- Ambiguous skin names (filenames without extension). Register + retrieve
|
||||
@ -42,7 +44,6 @@ local function run_unittest()
|
||||
assert(get_skin("player_Com_Pat_42") == "player._Com_Pat_42")
|
||||
assert(get_skin("player_Com_Pat_42_1") == "player._Com_Pat_42.1")
|
||||
|
||||
|
||||
error("Unittest passed! Please disable them now.")
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user