v/vlib/builtin/byte_test.v

20 lines
342 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
println(b[1].str() )
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
}