mirror of
https://github.com/vlang/v.git
synced 2025-08-03 17:57:59 -04:00
16 lines
414 B
V
16 lines
414 B
V
// vtest build: present_node?
|
|
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) == ''
|
|
}
|