Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkg/workflow/helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build !integration

package workflow

// contains checks if a string contains a substring.
// Deprecated: prefer strings.Contains or assert.Contains in new tests.
func contains(s, substr string) bool {
return len(s) >= len(substr) && (s == substr || len(substr) == 0 ||
(len(s) > len(substr) && s[len(s)-len(substr):] == substr) ||
(len(s) > len(substr) && s[:len(substr)] == substr) ||
(len(s) > len(substr) && findSubstring(s, substr)))
}

func findSubstring(s, substr string) bool {
for i := 0; i <= len(s)-len(substr); i++ {
if s[i:i+len(substr)] == substr {
return true
}
}
return false
}
Comment on lines +5 to +21
Loading