aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/strings/strings_test.v
blob: ff5ddf504a833f76a7b0218bd7dba8584ea4a4e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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) == ''
}