mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: add more interpolation tests
This commit is contained in:
parent
b0e498bf0b
commit
2ab2a58bc5
@ -62,3 +62,16 @@ fn test_string_interpolation_percent_escaping(){
|
|||||||
x := '%.*s$hello$test |${hello:-30s}|'
|
x := '%.*s$hello$test |${hello:-30s}|'
|
||||||
assert x == '%.*sworldhello |world |'
|
assert x == '%.*sworldhello |world |'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn test_string_interpolation_string_prefix() {
|
||||||
|
// `r`, `c` and `js` are also used as a string prefix.
|
||||||
|
r := 'r'
|
||||||
|
rr := '$r$r'
|
||||||
|
assert rr == 'rr'
|
||||||
|
c := 'c'
|
||||||
|
cc := '$c$c'
|
||||||
|
assert cc == 'cc'
|
||||||
|
js := 'js'
|
||||||
|
jsjs := '$js$js'
|
||||||
|
assert jsjs == 'jsjs'
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user