Skip to content

Commit

Permalink
make the test slightly more complex
Browse files Browse the repository at this point in the history
the goal is to test abusive inlining of the resulting string
  • Loading branch information
tsnobip committed Jan 15, 2024
1 parent b99312a commit 56b8642
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jscomp/test/tagged_template_lib.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exports.sql = (strings, ...values) => {
let result = "";
for (let i = 0; i < values.length; i++) {
result += strings[i] + values[i];
result += strings[i] + "'" + values[i] + "'";
}
result += strings[values.length];
return result;
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/tagged_template_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/tagged_template_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Mt.from_pair_suites(
list{
(
"with externals, it should return a string with the correct interpolations",
() => Eq(query, "SELECT * FROM users WHERE id = 5"),
() => Eq(query, "SELECT * FROM 'users' WHERE id = '5'"),
),
(
"with rescript function, it should return a string with the correct interpolations",
Expand Down

0 comments on commit 56b8642

Please sign in to comment.