Skip to content

Commit

Permalink
✅ test: refactor test cases #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Nov 7, 2024
1 parent 85161fb commit 3e57931
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,9 @@ func TestAppendIfMissing(t *testing.T) {
}{
{"example", "txt", "exampletxt", nil}, // Append missing suffix
{"example.txt", "txt", "example.txt", nil}, // Suffix already exists
{"example", "txt", "example", []string{"txt", "jpg"}}, // Multiple suffixes, no append needed
{"image", "jpg", "imagejpg", nil}, // Append suffix when missing
{"file.doc", "pdf", "file.docpdf", []string{"doc", "png"}}, // Append suffix, other suffix exists
{"report", "csv", "reportcsv", nil}, // Basic append case
{"document", "csv", "document", []string{"csv", "doc"}}, // Multiple suffixes, already ends with one
{"document", "csv", "documentcsv", []string{"csv", "doc"}}, // Multiple suffixes, already ends with one
{"hello", "o", "hello", nil}, // Edge case: ends with same letter
{"", "suffix", "", nil}, // Empty string
}
Expand All @@ -451,7 +449,6 @@ func TestAppendIfMissingIgnoreCase(t *testing.T) {
{"example", "Txt", "exampleTxt", nil}, // Append case-insensitive suffix
{"example.txt", "txt", "example.txt", nil}, // Suffix already exists
{"example.txt", "TXT", "example.txt", nil}, // Case-insensitive check
{"photo", "jpg", "photoJpg", nil}, // Append missing suffix with case-insensitive check
{"picture.PNG", "png", "picture.PNG", nil}, // Case-insensitive check with suffix present
{"report.PDF", "pdf", "report.PDF", nil}, // Case-insensitive check with suffix present
{"file", "txt", "filetxt", nil}, // Append suffix when missing
Expand Down

0 comments on commit 3e57931

Please sign in to comment.