mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
js: fix string.bytes codegen, readline, add tests for strings
(#12060)
This commit is contained in:
parent
e94e08475d
commit
8d1ba52d0c
14 changed files with 399 additions and 30 deletions
14
vlib/strings/strings_test.js.v
Normal file
14
vlib/strings/strings_test.js.v
Normal file
|
@ -0,0 +1,14 @@
|
|||
import strings
|
||||
|
||||
fn test_repeat() {
|
||||
assert strings.repeat(`x`, 10) == 'xxxxxxxxxx'
|
||||
assert strings.repeat(`a`, 1) == 'a'
|
||||
assert strings.repeat(`a`, 0) == ''
|
||||
}
|
||||
|
||||
fn test_repeat_string() {
|
||||
assert strings.repeat_string('abc', 3) == 'abcabcabc'
|
||||
assert strings.repeat_string('abc', 1) == 'abc'
|
||||
assert strings.repeat_string('abc', 0) == ''
|
||||
assert strings.repeat_string('', 200) == ''
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue