2019-07-03 22:11:27 +02:00
|
|
|
import strings
|
|
|
|
|
|
|
|
fn test_repeat() {
|
2019-12-22 00:05:30 +01:00
|
|
|
assert strings.repeat(`x`, 10) == 'xxxxxxxxxx'
|
|
|
|
assert strings.repeat(`a`, 1) == 'a'
|
|
|
|
assert strings.repeat(`a`, 0) == ''
|
|
|
|
}
|
2020-02-26 13:22:12 +01:00
|
|
|
|
|
|
|
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) == ''
|
|
|
|
}
|