Skip to content

Commit 2a5d567

Browse files
committed
add test for type resolution
1 parent 6004ecc commit 2a5d567

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

ql/test/type/Test.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ql
2+
3+
class Strings extends string {
4+
Strings() { this = ["", "f", "o", "foo", "bar", "b", "a", "r", "ba", "ar"] }
5+
}
6+
7+
class Floats extends float {
8+
Floats() { this = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
9+
}
10+
11+
string conc(Strings a, Strings b) { result = a + b }
12+
13+
float floats(Floats a, Floats b) { result = a + b }

ql/test/type/type.expected

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
| Test.qll:4:15:4:18 | this | Test.qll:3:1:5:1 | Strings |
2+
| Test.qll:4:15:4:18 | this | Test.qll:3:1:5:1 | Strings.Strings |
3+
| Test.qll:4:15:4:18 | this | Test.qll:3:1:5:1 | Strings.extends |
4+
| Test.qll:4:22:4:76 | Set | file://:0:0:0:0 | string |
5+
| Test.qll:4:23:4:24 | String | file://:0:0:0:0 | string |
6+
| Test.qll:4:27:4:29 | String | file://:0:0:0:0 | string |
7+
| Test.qll:4:32:4:34 | String | file://:0:0:0:0 | string |
8+
| Test.qll:4:37:4:41 | String | file://:0:0:0:0 | string |
9+
| Test.qll:4:44:4:48 | String | file://:0:0:0:0 | string |
10+
| Test.qll:4:51:4:53 | String | file://:0:0:0:0 | string |
11+
| Test.qll:4:56:4:58 | String | file://:0:0:0:0 | string |
12+
| Test.qll:4:61:4:63 | String | file://:0:0:0:0 | string |
13+
| Test.qll:4:66:4:69 | String | file://:0:0:0:0 | string |
14+
| Test.qll:4:72:4:75 | String | file://:0:0:0:0 | string |
15+
| Test.qll:8:14:8:17 | this | Test.qll:7:1:9:1 | Floats |
16+
| Test.qll:8:14:8:17 | this | Test.qll:7:1:9:1 | Floats.Floats |
17+
| Test.qll:8:14:8:17 | this | Test.qll:7:1:9:1 | Floats.extends |
18+
| Test.qll:8:21:8:70 | Set | file://:0:0:0:0 | float |
19+
| Test.qll:8:22:8:24 | Float | file://:0:0:0:0 | float |
20+
| Test.qll:8:27:8:29 | Float | file://:0:0:0:0 | float |
21+
| Test.qll:8:32:8:34 | Float | file://:0:0:0:0 | float |
22+
| Test.qll:8:37:8:39 | Float | file://:0:0:0:0 | float |
23+
| Test.qll:8:42:8:44 | Float | file://:0:0:0:0 | float |
24+
| Test.qll:8:47:8:49 | Float | file://:0:0:0:0 | float |
25+
| Test.qll:8:52:8:54 | Float | file://:0:0:0:0 | float |
26+
| Test.qll:8:57:8:59 | Float | file://:0:0:0:0 | float |
27+
| Test.qll:8:62:8:64 | Float | file://:0:0:0:0 | float |
28+
| Test.qll:8:67:8:69 | Float | file://:0:0:0:0 | float |
29+
| Test.qll:11:37:11:42 | result | file://:0:0:0:0 | string |
30+
| Test.qll:11:46:11:46 | a | Test.qll:3:1:5:1 | Strings |
31+
| Test.qll:11:50:11:50 | b | Test.qll:3:1:5:1 | Strings |
32+
| Test.qll:13:36:13:41 | result | file://:0:0:0:0 | float |
33+
| Test.qll:13:45:13:45 | a | Test.qll:7:1:9:1 | Floats |
34+
| Test.qll:13:49:13:49 | b | Test.qll:7:1:9:1 | Floats |

ql/test/type/type.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import ql
2+
3+
query Type getType(Expr e) { result = e.getType() }

0 commit comments

Comments
 (0)