mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
builtin: add a rune.bytes() convenience method (#13129)
This commit is contained in:
parent
791972ebc9
commit
078229f213
2 changed files with 9 additions and 0 deletions
|
@ -35,3 +35,8 @@ fn test_length_in_bytes() {
|
|||
//
|
||||
assert rune(0x110000).length_in_bytes() == -1
|
||||
}
|
||||
|
||||
fn test_bytes() {
|
||||
r1 := `★`
|
||||
assert r1.bytes() == [byte(0xe2), 0x98, 0x85]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue