Skip to content

Commit

Permalink
tests: add $tmpl test for #9838 (#20627)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrec committed Feb 1, 2024
1 parent fb0efc0 commit 0a612bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions vlib/v/tests/tmpl/interpolation.txt
@@ -0,0 +1 @@
result: @{my_fn("${my_var}")}
10 changes: 10 additions & 0 deletions vlib/v/tests/tmpl_test.v
Expand Up @@ -98,3 +98,13 @@ this is not ignored
so, it's basically true"
}

fn test_tmpl_interpolation() {
my_var := 'foo'
s := $tmpl('tmpl/interpolation.txt')
assert s == 'result: foo\n'
}

fn my_fn(s string) string {
return s
}

0 comments on commit 0a612bf

Please sign in to comment.