From 2ab2a58bc5a609260b66db4db5eee169b82bb43c Mon Sep 17 00:00:00 2001 From: Alexey Date: Sat, 18 Apr 2020 19:26:07 +0300 Subject: [PATCH] string: add more interpolation tests --- vlib/v/tests/string_interpolation_test.v | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vlib/v/tests/string_interpolation_test.v b/vlib/v/tests/string_interpolation_test.v index 9d45beb88c..01a9552b7f 100644 --- a/vlib/v/tests/string_interpolation_test.v +++ b/vlib/v/tests/string_interpolation_test.v @@ -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' +}