mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: add string.len_utf8()
method (#14208)
This commit is contained in:
@ -24,6 +24,14 @@ fn test_add() {
|
||||
assert a.ends_with('3')
|
||||
}
|
||||
|
||||
fn test_len_utf8() {
|
||||
assert 'Vlang'.len_utf8() == 5
|
||||
assert 'María'.len_utf8() == 5
|
||||
assert '姓名'.len_utf8() == 2
|
||||
assert 'Слово'.len_utf8() == 5
|
||||
assert 'Λέξη'.len_utf8() == 4
|
||||
}
|
||||
|
||||
fn test_ends_with() {
|
||||
a := 'browser.v'
|
||||
assert a.ends_with('.v')
|
||||
|
Reference in New Issue
Block a user