You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
953 B
48 lines
953 B
package util_test
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"git.aiterp.net/rpdata/logbot3/internal/util"
|
|
)
|
|
|
|
func TestRemoveNPCAttribution(t *testing.T) {
|
|
table := []struct {
|
|
Input string
|
|
Output string
|
|
}{
|
|
{
|
|
Input: "Character does stuff. (Player_Name)",
|
|
Output: "Character does stuff.",
|
|
},
|
|
{
|
|
Input: "Text (with some clarification) about stuff.",
|
|
Output: "Text (with some clarification) about stuff.",
|
|
},
|
|
{
|
|
Input: "Text without anything.",
|
|
Output: "Text without anything.",
|
|
},
|
|
{
|
|
Input: "((*Correction))",
|
|
Output: "((*Correction))",
|
|
},
|
|
{
|
|
Input: "((Remove :01 goofs!*))",
|
|
Output: "((Remove :01 goofs!*))",
|
|
},
|
|
}
|
|
|
|
for i, row := range table {
|
|
t.Run(fmt.Sprintf("Row_%d", i), func(t *testing.T) {
|
|
result := util.RemoveNPCAttribution(row.Input)
|
|
|
|
if result != row.Output {
|
|
t.Errorf("Row %d failed", i)
|
|
t.Errorf("Expected: %#+v", row.Output)
|
|
t.Errorf("Result: %#+v", result)
|
|
}
|
|
})
|
|
}
|
|
}
|