-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add string function test cases (#4)
* test: add string function test cases * test: add duckdb string functions to yaml * fix: fix null handling in duckdb * fix: add newline for concat * test: add string support to velox and use i64 for substring param * feat: add options for substring negative start
- Loading branch information
Showing
10 changed files
with
271 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function: concat | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 'abcd' | ||
type: string | ||
- value: 'efg' | ||
type: string | ||
result: | ||
value: 'abcdefg' | ||
type: string | ||
- group: | ||
id: null_input | ||
description: Examples with null as input | ||
args: | ||
- value: 'abcd' | ||
type: string | ||
- value: null | ||
type: string | ||
result: | ||
value: null | ||
type: string | ||
- group: null_input | ||
args: | ||
- value: null | ||
type: string | ||
- value: 'abcd' | ||
type: string | ||
result: | ||
value: null | ||
type: string | ||
- group: null_input | ||
args: | ||
- value: null | ||
type: string | ||
- value: null | ||
type: string | ||
result: | ||
value: null | ||
type: string |
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,60 @@ | ||
function: like | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 'abcdefg' | ||
type: string | ||
result: | ||
value: true | ||
type: boolean | ||
- group: basic | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 'abc' | ||
type: string | ||
result: | ||
value: false | ||
type: boolean | ||
- group: | ||
id: wildcard | ||
description: Examples using wildcards | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 'abc%' | ||
type: string | ||
result: | ||
value: true | ||
type: boolean | ||
- group: wildcard | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: '%efg' | ||
type: string | ||
result: | ||
value: true | ||
type: boolean | ||
- group: wildcard | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: '_bcdefg' | ||
type: string | ||
result: | ||
value: true | ||
type: boolean | ||
- group: wildcard | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 'abc_efg' | ||
type: string | ||
result: | ||
value: true | ||
type: boolean |
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,115 @@ | ||
function: substring | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 1 | ||
type: i32 | ||
- value: 5 | ||
type: i32 | ||
result: | ||
value: 'abcde' | ||
type: string | ||
- group: basic | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 1 | ||
type: i64 | ||
- value: 5 | ||
type: i64 | ||
result: | ||
value: 'abcde' | ||
type: string | ||
- group: | ||
id: start_greater_than_length | ||
description: Example where start argument greater than the length of the string | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 10 | ||
type: i32 | ||
- value: 2 | ||
type: i32 | ||
result: | ||
value: '' | ||
type: string | ||
- group: start_greater_than_length | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: 10 | ||
type: i64 | ||
- value: 2 | ||
type: i64 | ||
result: | ||
value: '' | ||
type: string | ||
- group: | ||
id: multi_byte_characters | ||
description: Example where multi byte characters exist in the string | ||
args: | ||
- value: '😊a😊b😊😊' | ||
type: string | ||
- value: 1 | ||
type: i32 | ||
- value: 3 | ||
type: i32 | ||
result: | ||
value: '😊a😊' | ||
type: string | ||
- group: multi_byte_characters | ||
args: | ||
- value: '😊a😊b😊😊' | ||
type: string | ||
- value: 1 | ||
type: i64 | ||
- value: 3 | ||
type: i64 | ||
result: | ||
value: '😊a😊' | ||
type: string | ||
- group: | ||
id: negative_start | ||
description: Example where start argument is a negative integer | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: -3 | ||
type: i64 | ||
- value: 2 | ||
type: i64 | ||
options: | ||
negative_start: WRAP_FROM_END | ||
result: | ||
value: 'ef' | ||
type: string | ||
- group: negative_start | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: -3 | ||
type: i64 | ||
- value: 4 | ||
type: i64 | ||
options: | ||
negative_start: LEFT_OF_BEGINNING | ||
result: | ||
value: '' | ||
type: string | ||
- group: negative_start | ||
args: | ||
- value: 'abcdefg' | ||
type: string | ||
- value: -3 | ||
type: i64 | ||
- value: 4 | ||
type: i64 | ||
options: | ||
negative_start: LEFT_OF_BEGINNING | ||
result: | ||
value: 'ab' | ||
type: string |
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