Skip to content

Commit

Permalink
fix with PR feedback: fix style (use camelcase), correct typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ntietz committed Jan 7, 2025
1 parent 56f060a commit bf6efc8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions goaway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ func TestFalsePositives(t *testing.T) {
}

func TestExactWord(t *testing.T) {
accept_sentences := []string{
acceptSentences := []string{
"I'm an analyst",
}
reject_sentences := []string{"Go away, ass."}
rejectSentences := []string{"Go away, ass."}
tests := []struct {
name string
profanityDetector *ProfanityDetector
Expand All @@ -564,12 +564,12 @@ func TestExactWord(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
for _, s := range accept_sentences {
for _, s := range acceptSentences {
if tt.profanityDetector.IsProfane(s) {
t.Error("Expected false, got true from:", s)
}
}
for _, s := range reject_sentences {
for _, s := range rejectSentences {
if !tt.profanityDetector.IsProfane(s) {
t.Error("Expected true, got false from:", s)
}
Expand All @@ -596,7 +596,7 @@ func TestFalseNegatives(t *testing.T) {
},
{
name: "With Custom Dictionary",
profanityDetector: NewProfanityDetector().WithCustomDictionary(DefaultProfanities, DefaultFalsePositives, DefaultFalseNegatives),
profanityDetector: NewProfanityDetector().WithExactWord(true).WithCustomDictionary(DefaultProfanities, DefaultFalsePositives, DefaultFalseNegatives),
},
}
for _, tt := range tests {
Expand Down

0 comments on commit bf6efc8

Please sign in to comment.