fortlit/main_test.go
2020-01-07 11:45:10 +01:00

29 lines
465 B
Go

package main
import (
"testing"
)
func TestDecorate(t *testing.T) {
tables := []struct {
q Quote
n string
}{
{
Quote{
"Max Mustermann",
"Testbook",
"This is a time!",
"time",
},
"\nThis is a \033[1;34mtime\033[0m!\n\n - Testbook, \033[1;36mMax Mustermann\033[0m\n",
},
}
for _, table := range tables {
r := table.q.decorate()
if r != table.n {
t.Errorf("string not is not \"%s\". got \"%s\".", table.n, r)
}
}
}