1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

more vfmt fixes

This commit is contained in:
Alexander Medvednikov
2019-11-10 03:08:53 +03:00
parent b9728c7af0
commit c7f3413d70
14 changed files with 76 additions and 74 deletions

View File

@ -1,5 +1,5 @@
import strings
fn test_sb() {
mut sb := strings.Builder{}
sb.write('hi')
@ -13,3 +13,22 @@ fn test_sb() {
assert sb.str() == 'ab'
}
const (
n = 100000
)
fn test_big_sb() {
mut sb := strings.new_builder(100)
for i in 0..n {
sb.writeln(i.str())
}
s := sb.str()
lines := s.split_into_lines()
assert lines.len == n
assert lines[0] == '0'
assert lines[1] == '1'
assert lines[777] == '777'
assert lines[98765] == '98765'
}