| # 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: |
| t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: |
| ./in.cue:4:5 |
| ./in.cue:4:19 |
| t10: invalid value "quux" (does not satisfy strings.MaxRunes(3)): |
| ./in.cue:12:6 |
| ./in.cue:12:23 |
| ./in.cue:12:28 |
| t12: invalid value "e" (does not satisfy strings.MaxRunes(0)): |
| ./in.cue:14:6 |
| ./in.cue:14:23 |
| ./in.cue:14:28 |
| t16: invalid value "hello" (does not satisfy strings.MaxRunes(3)): |
| ./in.cue:18:6 |
| ./in.cue:18:23 |
| ./in.cue:18:28 |
| t17: invalid value "hello" (does not satisfy strings.MinRunes(10)): |
| ./in.cue:19:6 |
| ./in.cue:19:23 |
| ./in.cue:19:29 |
| |
| Result: |
| t1: "Hello World!" |
| t2: _|_ // t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string |
| 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)) |
| |