Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uurien committed Aug 8, 2024
1 parent 7e0fb93 commit fb80364
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ function insertStr (str) {
return `pre_${str}_suf`
}

function templateLiteralEndingWithNumberParams (str) {
const num1 = 1
const num2 = 2
return `${str}Literal${num1}${num2}`
}

function appendStr (str) {
let pre = 'pre_'
pre += str
Expand Down Expand Up @@ -101,6 +107,7 @@ module.exports = {
sliceStr,
substrStr,
substringStr,
templateLiteralEndingWithNumberParams,
toLowerCaseStr,
toUpperCaseStr,
trimEndStr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const propagationFns = [
'sliceStr',
'substrStr',
'substringStr',
'templateLiteralEndingWithNumberParams',
'toLowerCaseStr',
'toUpperCaseStr',
'trimEndStr',
Expand Down Expand Up @@ -135,7 +136,8 @@ describe('TaintTracking', () => {
'arrayProtoJoin',
'concatSuffix',
'concatTaintedStr',
'insertStr'
'insertStr',
'templateLiteralEndingWithNumberParams'
]
propagationFns.forEach((propFn) => {
if (filtered.includes(propFn)) return
Expand Down

0 comments on commit fb80364

Please sign in to comment.