mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
Немного реструктуризации
Добавлен роут для смены скина
This commit is contained in:
22
lib/tools/tools_test.go
Normal file
22
lib/tools/tools_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package tools_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
. "elyby/minecraft-skinsystem/lib/tools"
|
||||
)
|
||||
|
||||
func TestParseUsername(t *testing.T) {
|
||||
if ParseUsername("test.png") != "test" {
|
||||
t.Error("Function should trim .png at end")
|
||||
}
|
||||
|
||||
if ParseUsername("test") != "test" {
|
||||
t.Error("Function should return string itself, if it not contains .png at end")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildKey(t *testing.T) {
|
||||
if BuildKey("Test") != "username:test" {
|
||||
t.Error("Function shound convert string to lover case and concatenate it with usernmae:")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user