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))", }, } 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) } }) } }