JS: Add test for WithArity

This commit is contained in:
Asger Feldthaus
2022-01-05 14:12:22 +01:00
parent 21928bee6c
commit d33200ea83
3 changed files with 11 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ taintFlow
| test.js:75:28:75:35 | source() | test.js:75:28:75:35 | source() |
| test.js:76:31:76:38 | source() | test.js:76:31:76:38 | source() |
| test.js:77:34:77:41 | source() | test.js:77:34:77:41 | source() |
| test.js:81:28:81:35 | source() | test.js:81:28:81:35 | source() |
isSink
| test.js:46:18:46:25 | source() | test-sink |
| test.js:47:22:47:29 | source() | test-sink |
@@ -68,3 +69,5 @@ isSink
| test.js:78:28:78:28 | 1 | test-sink |
| test.js:78:31:78:31 | 2 | test-sink |
| test.js:78:34:78:34 | 3 | test-sink |
| test.js:81:28:81:35 | source() | test-sink |
| test.js:82:28:82:28 | 1 | test-sink |

View File

@@ -76,4 +76,11 @@ function testSinks() {
testlib.mySinkExceptLast(1, source(), 3, 4); // NOT OK
testlib.mySinkExceptLast(1, 2, source(), 4); // NOT OK
testlib.mySinkExceptLast(1, 2, 3, source()); // OK
testlib.mySinkIfArityTwo(source()); // OK
testlib.mySinkIfArityTwo(source(), 2); // NOT OK
testlib.mySinkIfArityTwo(1, source()); // OK
testlib.mySinkIfArityTwo(source(), 2, 3); // OK
testlib.mySinkIfArityTwo(1, source(), 3); // OK
testlib.mySinkIfArityTwo(1, 2, source()); // OK
}

View File

@@ -28,6 +28,7 @@ class Sinks extends ModelInput::SinkModelCsv {
"testlib;;Member[mySinkTwoLast].Argument[N-1,N-2];test-sink",
"testlib;;Member[mySinkTwoLastRange].Argument[N-2..N-1];test-sink",
"testlib;;Member[mySinkExceptLast].Argument[0..N-2];test-sink",
"testlib;;Member[mySinkIfArityTwo].WithArity[2].Argument[0];test-sink",
]
}
}