File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package endoflife
22
33import (
44 "context"
5+ "strings"
56 "testing"
67 "time"
78
@@ -349,7 +350,7 @@ func TestProvider_BlocksNonStandardSchema(t *testing.T) {
349350 if err == nil {
350351 t .Errorf ("Expected error for %s (non-standard schema), got nil" , engine )
351352 }
352- if err != nil && ! contains (err .Error (), "non-standard" ) {
353+ if err != nil && ! strings . Contains (err .Error (), "non-standard" ) {
353354 t .Errorf ("Error should mention 'non-standard schema', got: %v" , err )
354355 }
355356
@@ -362,20 +363,6 @@ func TestProvider_BlocksNonStandardSchema(t *testing.T) {
362363 }
363364}
364365
365- // Helper function for string contains
366- func contains (s , substr string ) bool {
367- return len (s ) >= len (substr ) && (s == substr || substr == "" ||
368- (s != "" && substr != "" && indexOfSubstring (s , substr ) >= 0 ))
369- }
370-
371- func indexOfSubstring (s , substr string ) int {
372- for i := 0 ; i <= len (s )- len (substr ); i ++ {
373- if s [i :i + len (substr )] == substr {
374- return i
375- }
376- }
377- return - 1
378- }
379366
380367func TestConvertCycle_ExtendedSupport (t * testing.T ) {
381368 provider := NewProvider (& MockClient {}, 1 * time .Hour )
You can’t perform that action at this time.
0 commit comments