1
0

decoupled some stuffs, news related tests, new commands file

This commit is contained in:
2020-12-08 14:47:34 +01:00
parent 804ed6ee5b
commit 53d01e04fe
6 changed files with 103 additions and 68 deletions

View File

@ -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()
}
}