Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ca294a

Browse files
committed
JS: Merge TypeScript/CallSignatures test
1 parent 3f3b0e5 commit 8ca294a

8 files changed

Lines changed: 29 additions & 23 deletions

File tree

javascript/ql/test/library-tests/TypeScript/CallSignatures/CallSignatures.expected

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

javascript/ql/test/library-tests/TypeScript/CallSignatures/CallSignatures.ql

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

javascript/ql/test/library-tests/TypeScript/CallSignatures/IndexSignatures.expected

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

javascript/ql/test/library-tests/TypeScript/CallSignatures/IndexSignatures.ql

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

javascript/ql/test/library-tests/TypeScript/CallSignatures/MethodDeclarations.expected

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

javascript/ql/test/library-tests/TypeScript/CallSignatures/MethodDeclarations.ql

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
test_CallSignature
2+
| tst.ts:7:3:7:22 | (x: number): number; | interface I | tst.ts:7:3:7:22 | (x: number): number; | abstract |
3+
| tst.ts:8:3:8:21 | new (x: number): C; | interface I | tst.ts:8:3:8:21 | new (x: number): C; | abstract |
4+
| tst.ts:13:3:13:22 | (x: number): number; | anonymous interface | tst.ts:13:3:13:22 | (x: number): number; | abstract |
5+
| tst.ts:14:3:14:21 | new (x: number): C; | anonymous interface | tst.ts:14:3:14:21 | new (x: number): C; | abstract |
6+
test_IndexSignature
7+
| tst.ts:9:3:9:22 | [x: number]: string; | interface I | tst.ts:9:3:9:22 | [x: number]: string; | abstract |
8+
| tst.ts:15:3:15:22 | [x: number]: string; | anonymous interface | tst.ts:15:3:15:22 | [x: number]: string; | abstract |
9+
test_MethodDeclarations
10+
| tst.ts:1:18:1:17 | constructor() {} | Method constructor in class C |
11+
| tst.ts:2:3:2:31 | abstrac ... number; | Method abstract in class C |
12+
| tst.ts:3:3:3:30 | abstrac ... er): C; | Method new in class C |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import javascript
2+
3+
query predicate test_CallSignature(CallSignature call, string declType, ASTNode body, string abstractness) {
4+
(if call.isAbstract() then abstractness = "abstract" else abstractness = "not abstract") and
5+
declType = call.getDeclaringType().describe() and
6+
body = call.getBody()
7+
}
8+
9+
query predicate test_IndexSignature(IndexSignature sig, string declType, ASTNode body, string abstractness) {
10+
(if sig.isAbstract() then abstractness = "abstract" else abstractness = "not abstract") and
11+
declType = sig.getDeclaringType().describe() and
12+
body = sig.getBody()
13+
}
14+
15+
query predicate test_MethodDeclarations(MethodDeclaration method, string descr) {
16+
descr = "Method " + method.getName() + " in " + method.getDeclaringType().describe()
17+
}

0 commit comments

Comments
 (0)