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

tests: valgrind: string.replace()

This commit is contained in:
Alexander Medvednikov 2020-05-24 07:19:58 +00:00
parent 06540f0e91
commit 494f4fe986

View File

@ -16,12 +16,24 @@ fn foo() {
//str_inter := 'hello, $name' // concatenated strings must be freed
//nums.free() // this should result in a double free and a CI error
}
fn str_replace() {
s := 'hello world'
r := s.replace('hello', 'hi')
cloned := s.replace('hello', 'hi').clone()
cloned2 := r.clone()
println(s)
println(r)
}
fn main() {
println('start')
foo()
str_replace()
println('end')
}