-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEOS-1489 Fix default being converted to database DEFAULT (#2741)
- Loading branch information
1 parent
c5d48b6
commit 074ff2c
Showing
22 changed files
with
514 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package gotypeutil | ||
|
||
import "strings" | ||
|
||
func CaseInsensitiveContains(s, substr string) bool { | ||
return strings.Contains(strings.ToLower(s), strings.ToLower(substr)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package gotypeutil | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_CaseInsensitiveContains(t *testing.T) { | ||
t.Run("CaseInsensitiveContains", func(t *testing.T) { | ||
require.True(t, CaseInsensitiveContains("Hello, World!", "hello"), "Should find lowercase substring") | ||
require.True(t, CaseInsensitiveContains("Hello, World!", "WORLD"), "Should find uppercase substring") | ||
require.True(t, CaseInsensitiveContains("Hello, World!", "o, wo"), "Should find mixed case substring") | ||
require.True(t, CaseInsensitiveContains("Hello, World!", ""), "Should return true for empty substring") | ||
require.True(t, CaseInsensitiveContains("Hello, World!", "Hello, World!"), "Should find when substring is equal to string") | ||
|
||
require.False(t, CaseInsensitiveContains("Hello, World!", "goodbye"), "Should not find non-existent substring") | ||
require.False(t, CaseInsensitiveContains("", "test"), "Should return false when string is empty and substring is not") | ||
require.False(t, CaseInsensitiveContains("Hello", "Hello, World!"), "Should return false when substring is longer than string") | ||
|
||
require.True(t, CaseInsensitiveContains("HeLLo, WoRLD!", "hello, world!"), "Should handle mixed case in both string and substring") | ||
require.True(t, CaseInsensitiveContains("HELLO", "hello"), "Should handle all uppercase string and lowercase substring") | ||
require.True(t, CaseInsensitiveContains("hello", "HELLO"), "Should handle all lowercase string and uppercase substring") | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.