Skip to content

Commit 2546168

Browse files
authored
test(muxer): remove containsString helper (#1313)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent f04da14 commit 2546168

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

muxer/muxer_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ func TestDiffusionModes(t *testing.T) {
477477
select {
478478
case err := <-m.ErrorChan():
479479
if tt.expectError {
480-
if !containsString(err.Error(), tt.errorContains) {
480+
if !strings.Contains(err.Error(), tt.errorContains) {
481481
t.Errorf(
482482
"expected error containing %q, got: %v",
483483
tt.errorContains,
@@ -530,7 +530,7 @@ func TestErrorHandling(t *testing.T) {
530530
select {
531531
case err := <-m.ErrorChan():
532532
if err == nil ||
533-
!containsString(err.Error(), "zero-byte segment payload") {
533+
!strings.Contains(err.Error(), "zero-byte segment payload") {
534534
t.Errorf("expected zero-byte payload error, got: %v", err)
535535
}
536536
default:
@@ -556,7 +556,7 @@ func TestErrorHandling(t *testing.T) {
556556
select {
557557
case err := <-m.ErrorChan():
558558
if err == nil ||
559-
!containsString(err.Error(), "unknown protocol ID") {
559+
!strings.Contains(err.Error(), "unknown protocol ID") {
560560
t.Errorf("expected unknown protocol error, got: %v", err)
561561
}
562562
default:
@@ -681,8 +681,3 @@ func createSegmentData(segment *muxer.Segment) []byte {
681681
buf.Write(segment.Payload)
682682
return buf.Bytes()
683683
}
684-
685-
// containsString checks if a string contains a substring
686-
func containsString(s, substr string) bool {
687-
return strings.Contains(s, substr)
688-
}

0 commit comments

Comments
 (0)