...
1# generated from the original tests.
2# Henceforth it may be nicer to group tests into separate files.
3-- in.cue --
4import "strings"
5
6t1: strings.Join(["Hello", "World!"], " ")
7t2: strings.Join([1, 2], " ")
8t3: strings.ByteAt("a", 0)
9t4: strings.ByteSlice("Hello", 2, 5)
10t5: strings.SliceRunes("✓ Hello", 0, 3)
11t6: strings.Runes("Café")
12t7: strings.ToCamel("AlphaBeta")
13t8: strings.ToTitle("alpha")
14t9: strings.MaxRunes(3) & "foo"
15t10: strings.MaxRunes(3) & "quux"
16t11: strings.MinRunes(1) & "e"
17t12: strings.MaxRunes(0) & "e"
18t13: strings.MaxRunes(0) & ""
19t14: strings.MinRunes(3) & "hello"
20t15: strings.MaxRunes(10) & "hello"
21t16: strings.MaxRunes(3) & "hello"
22t17: strings.MinRunes(10) & "hello"
23-- out/strings --
24Errors:
25t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string:
26 ./in.cue:4:6
27 ./in.cue:4:20
28t10: invalid value "quux" (does not satisfy strings.MaxRunes(3)):
29 ./in.cue:12:6
30 ./in.cue:12:23
31 ./in.cue:12:28
32t12: invalid value "e" (does not satisfy strings.MaxRunes(0)):
33 ./in.cue:14:6
34 ./in.cue:14:23
35 ./in.cue:14:28
36t16: invalid value "hello" (does not satisfy strings.MaxRunes(3)):
37 ./in.cue:18:6
38 ./in.cue:18:23
39 ./in.cue:18:28
40t17: invalid value "hello" (does not satisfy strings.MinRunes(10)):
41 ./in.cue:19:6
42 ./in.cue:19:23
43 ./in.cue:19:29
44
45Result:
46t1: "Hello World!"
47t2: _|_ // t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string
48t3: 97
49t4: 'llo'
50t5: "✓ H"
51t6: [67, 97, 102, 233]
52t7: "alphaBeta"
53t8: "Alpha"
54t9: "foo"
55t10: _|_ // t10: invalid value "quux" (does not satisfy strings.MaxRunes(3))
56t11: "e"
57t12: _|_ // t12: invalid value "e" (does not satisfy strings.MaxRunes(0))
58t13: ""
59t14: "hello"
60t15: "hello"
61t16: _|_ // t16: invalid value "hello" (does not satisfy strings.MaxRunes(3))
62t17: _|_ // t17: invalid value "hello" (does not satisfy strings.MinRunes(10))
View as plain text