Skip to content

Commit f69ea7f

Browse files
committed
Python: Add redimentary tests for new Value API.
1 parent f0bb07f commit f69ea7f

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| file://:0:0:0:0 | builtin-class bool | bool |
2+
| file://:0:0:0:0 | builtin-class classmethod | classmethod |
3+
| file://:0:0:0:0 | builtin-class float | float |
4+
| file://:0:0:0:0 | builtin-class int | int |
5+
| file://:0:0:0:0 | builtin-class object | object |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import python
2+
3+
from ClassValue cls, string description
4+
where
5+
cls = ClassValue::bool() and description = "bool"
6+
or
7+
cls = ClassValue::int_() and description = "int"
8+
or
9+
cls = ClassValue::float_() and description = "float"
10+
or
11+
cls = ClassValue::classmethod() and description = "classmethod"
12+
or
13+
cls = ClassValue::bool().getMro().getItem(2) and description = "object"
14+
15+
select cls, description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| file://:0:0:0:0 | builtin-class ValueError | ValueError |
2+
| file://:0:0:0:0 | builtin-class bool | bool |
3+
| file://:0:0:0:0 | builtin-class slice | slice |
4+
| file://:0:0:0:0 | list object | sys.argv |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import python
2+
3+
from Value val, string name
4+
where
5+
val = Value::named(name)
6+
and
7+
(
8+
name = "bool" or name = "sys" or name = "sys.argv" or
9+
name = "ValueError" or name = "slice"
10+
)
11+
12+
select val, name

0 commit comments

Comments
 (0)