string: add more interpolation tests

pull/4490/head
Alexey 2020-04-18 19:26:07 +03:00 committed by GitHub
parent b0e498bf0b
commit 2ab2a58bc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -62,3 +62,16 @@ fn test_string_interpolation_percent_escaping(){
x := '%.*s$hello$test |${hello:-30s}|'
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'
}