mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin,ast: apply small performance improvements, suggested by hotspot
This commit is contained in:
@ -686,6 +686,14 @@ fn test_starts_with() {
|
||||
assert s.starts_with('Language') == false
|
||||
}
|
||||
|
||||
fn test_starts_with_capital() {
|
||||
assert 'A sentence'.starts_with_capital()
|
||||
assert 'A paragraph. It also does.'.starts_with_capital()
|
||||
assert ''.starts_with_capital() == false
|
||||
assert 'no'.starts_with_capital() == false
|
||||
assert ' No'.starts_with_capital() == false
|
||||
}
|
||||
|
||||
fn test_trim_prefix() {
|
||||
s := 'V Programming Language'
|
||||
assert s.trim_prefix('V ') == 'Programming Language'
|
||||
|
Reference in New Issue
Block a user