Skip to content

Commit 256f3b0

Browse files
author
Max Schaefer
committed
JavaScript: Consolidate tutorial tests.
1 parent 5a242d4 commit 256f3b0

60 files changed

Lines changed: 232 additions & 156 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.ql

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import javascript
2+
3+
query predicate test_query1(string res0, int res1) {
4+
exists(Folder d |
5+
res0 = d.getRelativePath() and
6+
res1 = count(File f | f = d.getAFile() and f.getExtension() = "js" | f)
7+
)
8+
}

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.ql

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import javascript
2+
3+
query predicate test_query10(Function f, string res) {
4+
exists(GlobalVariable gv |
5+
gv.getAnAccess().getEnclosingFunction() = f and not f.getStartBB().isLiveAtEntry(gv, _)
6+
|
7+
res = "This function uses " + gv.toString() + " like a local variable."
8+
)
9+
}

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.expected

Lines changed: 0 additions & 4 deletions
This file was deleted.

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.ql

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import javascript
2+
3+
query predicate test_query11(VarDef def, string res) {
4+
exists(LocalVariable v | v = def.getAVariable() and not exists(VarUse use | def = use.getADef()) |
5+
res = "Dead store of local variable."
6+
)
7+
}

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.expected

Whitespace-only changes.

0 commit comments

Comments
 (0)