mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: fix some interpolation tests
This commit is contained in:
parent
604f19adba
commit
e1ffc76efd
@ -516,7 +516,7 @@ fn test_struct_print() {
|
|||||||
}
|
}
|
||||||
a.b << b
|
a.b << b
|
||||||
a.b << b
|
a.b << b
|
||||||
assert a.str() == '{Test [{1 2}, {1 2}]}'
|
assert a.str() == '\{Test [{1 2}, {1 2}]}'
|
||||||
assert b.str() == '{1 2}'
|
assert b.str() == '{1 2}'
|
||||||
assert a.b.str() == '[{1 2}, {1 2}]'
|
assert a.b.str() == '[{1 2}, {1 2}]'
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,9 @@ const expected_string_outputs = [
|
|||||||
|
|
||||||
fn test_find_between_pair_family() {
|
fn test_find_between_pair_family() {
|
||||||
assert strings.find_between_pair_rune('xx♡ok❦yy', `♡`, `❦`) == 'ok'
|
assert strings.find_between_pair_rune('xx♡ok❦yy', `♡`, `❦`) == 'ok'
|
||||||
assert strings.find_between_pair_u8('xx{ok}yy', `{`, `}`) == 'ok'
|
assert strings.find_between_pair_u8('xx\{ok}yy', `{`, `}`) == 'ok'
|
||||||
assert strings.find_between_pair_string('xx/*ok*/yy', '/*', '*/') == 'ok'
|
assert strings.find_between_pair_string('xx/*ok*/yy', '/*', '*/') == 'ok'
|
||||||
assert strings.find_between_pair_u8('xx{ok}yy', `{`, `}`) == 'ok'
|
assert strings.find_between_pair_u8('xx\{ok}yy', `{`, `}`) == 'ok'
|
||||||
assert strings.find_between_pair_string('xxxxokyyyy', 'xxx', 'yyy') == 'xok'
|
assert strings.find_between_pair_string('xxxxokyyyy', 'xxx', 'yyy') == 'xok'
|
||||||
|
|
||||||
for i, tstr in test_rune_and_byte {
|
for i, tstr in test_rune_and_byte {
|
||||||
|
@ -1243,7 +1243,7 @@ fn (mut s Scanner) ident_string() string {
|
|||||||
if s.text[i] in [`=`, `:`, `\n`, s.inter_quote] {
|
if s.text[i] in [`=`, `:`, `\n`, s.inter_quote] {
|
||||||
// We reached the end of the line or string without reaching "}".
|
// We reached the end of the line or string without reaching "}".
|
||||||
// Also if there's "=", there's no way it's a valid interpolation expression:
|
// Also if there's "=", there's no way it's a valid interpolation expression:
|
||||||
// e.g. `println("{a.b = 42}")`
|
// e.g. `println("{a.b = 42}")` `println('{foo:bar}')`
|
||||||
is_valid_inter = false
|
is_valid_inter = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user