decoupled some stuffs, news related tests, new commands file
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateAudioSimple(t *testing.T) {
|
||||
var message string = "test 1 2 3"
|
||||
filename, file := createAudio(message)
|
||||
filename, file := getAudioMessage(message)
|
||||
if file == nil || len(filename) <= 0 {
|
||||
t.Fail()
|
||||
}
|
||||
@ -29,10 +29,29 @@ func TestPrepareTTSMessageBigText(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// strip custom emojis
|
||||
func TestPrepareTTSEmoji(t *testing.T) {
|
||||
var message string = "This is awesome!!! :thumbsup: :nerd_face: :cop:"
|
||||
cleanMessage := prepareTTSMessage(message)
|
||||
if cleanMessage != "This is awesome!!!" {
|
||||
t.Fail()
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
// contains every commands from the register + the welcome message
|
||||
func TestGetHelpMessage(t *testing.T) {
|
||||
//ConfigRegister.LoadConf()
|
||||
CommandInit()
|
||||
var help string = getHelpMessage()
|
||||
if strings.Count(help, "\n") != (len(CommandRegister) + 1) {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
// it's just hats, what else is there to check
|
||||
func TestGetHatMessage(t *testing.T) {
|
||||
var hats string = getHatMessage()
|
||||
if len(hats) <= 0 {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user