v/vlib/builtin/byte_test.v

19 lines
346 B
V
Raw Normal View History

2019-07-25 18:07:16 +02:00
fn test_clone() {
2020-08-27 06:46:18 +02:00
a := [byte(0), 1, 2]
2019-07-25 18:07:16 +02:00
b := a.clone()
assert b.len == 3
2020-08-27 06:46:18 +02:00
assert b[0] == 0
assert b[1] == 1
assert b[2] == 2
2021-01-05 19:14:35 +01:00
println(b[1].ascii_str())
2020-08-27 06:46:18 +02:00
println(typeof(`A`))
x := rune(`A`)
assert x.str() == 'A'
assert typeof(x) == 'rune'
//
y := `Z`
assert typeof(y) == 'rune'
assert y.str() == 'Z'
// assert b[1].str() == '1' TODO
}