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:
parent
06540f0e91
commit
494f4fe986
@ -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')
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user