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:
@ -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'
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user