Skip to content

Commit

Permalink
test identity function
Browse files Browse the repository at this point in the history
  • Loading branch information
yinwang0 committed Nov 9, 2016
1 parent 945a94b commit d1b53f0
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
111 changes: 111 additions & 0 deletions tests/identity.test/refs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
[
{
"ref": {
"name": "foo",
"file": "test1.py",
"start": 75,
"end": 78
},
"dests": [
{
"name": "foo",
"file": "test1.py",
"start": 12,
"end": 15,
"type": "bool -\u003e bool ∧ int -\u003e int -\u003e (int, bool)"
}
]
},
{
"ref": {
"name": "id",
"file": "test1.py",
"start": 79,
"end": 81
},
"dests": [
{
"name": "id",
"file": "test1.py",
"start": 50,
"end": 52,
"type": "bool -\u003e bool ∧ int -\u003e int"
}
]
},
{
"ref": {
"name": "f",
"file": "test1.py",
"start": 31,
"end": 32
},
"dests": [
{
"name": "f",
"file": "test1.py",
"start": 16,
"end": 17,
"type": "bool -\u003e bool ∧ int -\u003e int"
}
]
},
{
"ref": {
"name": "x",
"file": "test1.py",
"start": 68,
"end": 69
},
"dests": [
{
"name": "x",
"file": "test1.py",
"start": 53,
"end": 54,
"type": "int"
},
{
"name": "x",
"file": "test1.py",
"start": 53,
"end": 54,
"type": "bool"
}
]
},
{
"ref": {
"name": "f",
"file": "test1.py",
"start": 37,
"end": 38
},
"dests": [
{
"name": "f",
"file": "test1.py",
"start": 16,
"end": 17,
"type": "bool -\u003e bool ∧ int -\u003e int"
}
]
},
{
"ref": {
"name": "a",
"file": "test1.py",
"start": 89,
"end": 90
},
"dests": [
{
"name": "a",
"file": "test1.py",
"start": 71,
"end": 72,
"type": "(int, bool)"
}
]
}
]
12 changes: 12 additions & 0 deletions tests/identity.test/test1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# test

def foo(f):
return f(1), f(True)

def id(x):
return x

a = foo(id)
print(a)


0 comments on commit d1b53f0

Please sign in to comment.