blob: 837820bfba5b4d97db5d36bacc8c13287e7bdc14 [file] [log] [blame]
# generated from the original tests.
# Henceforth it may be nicer to group tests into separate files.
-- in.cue --
import "strings"
t1: strings.Join(["Hello", "World!"], " ")
t2: strings.Join([1, 2], " ")
t3: strings.ByteAt("a", 0)
t4: strings.ByteSlice("Hello", 2, 5)
t5: strings.SliceRunes("✓ Hello", 0, 3)
t6: strings.Runes("Café")
t7: strings.ToCamel("AlphaBeta")
t8: strings.ToTitle("alpha")
t9: strings.MaxRunes(3) & "foo"
t10: strings.MaxRunes(3) & "quux"
t11: strings.MinRunes(1) & "e"
t12: strings.MaxRunes(0) & "e"
t13: strings.MaxRunes(0) & ""
t14: strings.MinRunes(3) & "hello"
t15: strings.MaxRunes(10) & "hello"
t16: strings.MaxRunes(3) & "hello"
t17: strings.MinRunes(10) & "hello"
-- out/strings --
Errors:
0: error in call to strings.Join: element 0 of list argument 0: cannot use value 1 (type int) as string
t10: invalid value "quux" (does not satisfy strings.MaxRunes(3)):
./in.cue:12:6
t12: invalid value "e" (does not satisfy strings.MaxRunes(0)):
./in.cue:14:6
t16: invalid value "hello" (does not satisfy strings.MaxRunes(3)):
./in.cue:18:6
t17: invalid value "hello" (does not satisfy strings.MinRunes(10)):
./in.cue:19:6
Result:
t1: "Hello World!"
t2: _|_ // error in call to strings.Join: element 0 of list argument 0: 0: cannot use value 1 (type int) as string (and 1 more errors)
t3: 97
t4: 'llo'
t5: "✓ H"
t6: [67, 97, 102, 233]
t7: "alphaBeta"
t8: "Alpha"
t9: "foo"
t10: _|_ // t10: invalid value "quux" (does not satisfy strings.MaxRunes(3))
t11: "e"
t12: _|_ // t12: invalid value "e" (does not satisfy strings.MaxRunes(0))
t13: ""
t14: "hello"
t15: "hello"
t16: _|_ // t16: invalid value "hello" (does not satisfy strings.MaxRunes(3))
t17: _|_ // t17: invalid value "hello" (does not satisfy strings.MinRunes(10))