Files
regorus/tests/interpreter/cases/builtins/strings/lower.yaml
Sumedh Alok Sharma 8498274356 Add tests for builtin strings::lower method (#313)
Signed-off-by: Sumedh Alok Sharma <sumsharma@microsoft.com>
2024-09-11 09:15:28 -07:00

80 lines
1.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: base
data: {}
modules:
- |
package test
v1 = lower("") # empty string
v2 = lower("a")
v3 = lower("A")
v4 = lower("AbCd")
v5 = lower("aBcD109")
v6 = lower("aabAB09_")
v7 = lower("longStrinGwitHmixofsmaLLandcAps")
query: data.test
want_result:
v1: ""
v2: "a"
v3: "a"
v4: "abcd"
v5: "abcd109"
v6: "aabab09_"
v7: "longstringwithmixofsmallandcaps"
- note: unicode string
data: {}
modules:
- |
package test
v1 = lower("Σ")
v2 = lower("ὈΔΥΣΣΕΎΣ")
v3 = lower("LONG\u2C6FSTRING\u2C6FWITH\u2C6FNONASCII\u2C6FCHARS")
query: data.test
want_result:
v1: "σ"
v2: "ὀδυσσεύς"
v3: "long\u0250string\u0250with\u0250nonascii\u0250chars"
- note: invalid-null-string
data: {}
modules: ["package test\nx=lower(null)"]
query: data.test
error: "`lower` expects string argument."
- note: invalid-bool-string
data: {}
modules: ["package test\nx=lower(true)"]
query: data.test
error: "`lower` expects string argument."
- note: invalid-number-string
data: {}
modules: ["package test\nx=lower(1)"]
query: data.test
error: "`lower` expects string argument."
- note: invalid-array-string
data: {}
modules: ["package test\nx=lower([])"]
query: data.test
error: "`lower` expects string argument."
- note: invalid-set-string
data: {}
modules: ["package test\nx=lower(set())"]
query: data.test
error: "`lower` expects string argument."
- note: invalid-object-string
data: {}
modules: ["package test\nx=lower({})"]
query: data.test
error: "`lower` expects string argument."