mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
scanner: string interpolation with $var at the end
This commit is contained in:
parent
1372d04b43
commit
d6d17fe3f2
3 changed files with 14 additions and 2 deletions
|
@ -15,3 +15,15 @@ fn test_excape_dollar_in_string() {
|
|||
assert !'(\\\\${i})'.contains('i') && '(\\\\${i})'.contains('42') && '(\\\\${i})'.contains('\\\\')
|
||||
assert i==42
|
||||
}
|
||||
|
||||
fn test_implicit_str() {
|
||||
i := 42
|
||||
assert 'int $i' == 'int 42'
|
||||
assert '$i' == '42'
|
||||
|
||||
check := '$i' == '42'
|
||||
assert check
|
||||
|
||||
text := '$i' + '42'
|
||||
assert text == '4242'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue