Skip to content

Commit 487edae

Browse files
committed
sourcegraph#86 - Splits test cases for enclosing_range
1 parent e0a3d30 commit 487edae

File tree

10 files changed

+177
-54
lines changed

10 files changed

+177
-54
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def class_decorator(cls):
2+
def wrapper(*args, **kwargs):
3+
return cls(*args, **kwargs)
4+
return wrapper
5+
6+
@class_decorator
7+
class Test:
8+
def __init__(self, x: float):
9+
self.x = x
10+
11+
def test(self) -> float:
12+
return self.x
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Test():
2+
pass
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def decorator(func):
2+
def wrapper(*args, **kwargs):
3+
return func(*args, **kwargs)
4+
return wrapper
5+
6+
@decorator
7+
def func(x: float) -> float:
8+
test = x
9+
10+
return test
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def simple(x):
2+
return x

packages/pyright-scip/snapshots/input/one_function/function.py

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# < definition scip-python python snapshot-util 0.1 advanced/__init__:
2+
#documentation (module) advanced
3+
4+
def class_decorator(cls):
5+
# ^^^^^^^^^^^^^^^ definition <enclosing 0, 0, 3, 18> snapshot-util 0.1 advanced/class_decorator().
6+
# documentation ```python
7+
# > def class_decorator(
8+
# > cls
9+
# > ): # -> (*args: Unknown, **kwargs: Unkno...
10+
# > ```
11+
# ^^^ definition snapshot-util 0.1 advanced/class_decorator().(cls)
12+
def wrapper(*args, **kwargs):
13+
# ^^^^^^^ definition <enclosing 1, 4, 2, 35> snapshot-util 0.1 advanced/class_decorator().wrapper().
14+
# documentation ```python
15+
# > def wrapper(
16+
# > *args,
17+
# > **kwargs
18+
# > ):
19+
# > ```
20+
# ^^^^ definition snapshot-util 0.1 advanced/class_decorator().wrapper().(args)
21+
# ^^^^^^ definition snapshot-util 0.1 advanced/class_decorator().wrapper().(kwargs)
22+
return cls(*args, **kwargs)
23+
# ^^^ reference snapshot-util 0.1 advanced/class_decorator().(cls)
24+
# ^^^^ reference snapshot-util 0.1 advanced/class_decorator().wrapper().(args)
25+
# ^^^^^^ reference snapshot-util 0.1 advanced/class_decorator().wrapper().(kwargs)
26+
return wrapper
27+
# ^^^^^^^ reference snapshot-util 0.1 advanced/class_decorator().wrapper().
28+
29+
@class_decorator
30+
#^^^^^^^^^^^^^^^ reference snapshot-util 0.1 advanced/class_decorator().
31+
class Test:
32+
# ^^^^ definition <enclosing 5, 0, 11, 21> snapshot-util 0.1 advanced/Test#
33+
# documentation ```python
34+
# > @class_decorator
35+
# > class Test:
36+
# > ```
37+
# ^^^^ definition snapshot-util 0.1 advanced/Test#
38+
def __init__(self, x: float):
39+
# ^^^^^^^^ definition <enclosing 7, 4, 8, 18> snapshot-util 0.1 advanced/Test#__init__().
40+
# documentation ```python
41+
# > def __init__(
42+
# > self,
43+
# > x: float
44+
# > ) -> None:
45+
# > ```
46+
# ^^^^ definition snapshot-util 0.1 advanced/Test#__init__().(self)
47+
# ^ definition snapshot-util 0.1 advanced/Test#__init__().(x)
48+
# ^^^^^ reference python-stdlib 3.11 builtins/float#
49+
# external documentation ```python
50+
# > (class) float
51+
# > ```
52+
self.x = x
53+
# ^^^^ reference snapshot-util 0.1 advanced/Test#__init__().(self)
54+
# ^ definition snapshot-util 0.1 advanced/Test#x.
55+
# documentation ```python
56+
# > (variable) x: float
57+
# > ```
58+
# ^ reference snapshot-util 0.1 advanced/Test#__init__().(x)
59+
60+
def test(self) -> float:
61+
# ^^^^ definition <enclosing 10, 4, 11, 21> snapshot-util 0.1 advanced/Test#test().
62+
# documentation ```python
63+
# > def test(
64+
# > self
65+
# > ) -> float:
66+
# > ```
67+
# ^^^^ definition snapshot-util 0.1 advanced/Test#test().(self)
68+
# ^^^^^ reference python-stdlib 3.11 builtins/float#
69+
return self.x
70+
# ^^^^ reference snapshot-util 0.1 advanced/Test#test().(self)
71+
# ^ reference snapshot-util 0.1 advanced/Test#x.
72+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# < definition scip-python python snapshot-util 0.1 simple/__init__:
2+
#documentation (module) simple
3+
4+
class Test():
5+
# ^^^^ definition <enclosing 0, 0, 1, 6> snapshot-util 0.1 simple/Test#
6+
# documentation ```python
7+
# > class Test:
8+
# > ```
9+
# ^^^^ definition snapshot-util 0.1 simple/Test#
10+
pass
11+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# < definition scip-python python snapshot-util 0.1 advanced/__init__:
2+
#documentation (module) advanced
3+
4+
def decorator(func):
5+
# ^^^^^^^^^ definition <enclosing 0, 0, 3, 18> snapshot-util 0.1 advanced/decorator().
6+
# documentation ```python
7+
# > def decorator(
8+
# > func
9+
# > ): # -> (*args: Unknown, **kwargs: Unkno...
10+
# > ```
11+
# ^^^^ definition snapshot-util 0.1 advanced/decorator().(func)
12+
def wrapper(*args, **kwargs):
13+
# ^^^^^^^ definition <enclosing 1, 4, 2, 36> snapshot-util 0.1 advanced/decorator().wrapper().
14+
# documentation ```python
15+
# > def wrapper(
16+
# > *args,
17+
# > **kwargs
18+
# > ):
19+
# > ```
20+
# ^^^^ definition snapshot-util 0.1 advanced/decorator().wrapper().(args)
21+
# ^^^^^^ definition snapshot-util 0.1 advanced/decorator().wrapper().(kwargs)
22+
return func(*args, **kwargs)
23+
# ^^^^ reference snapshot-util 0.1 advanced/decorator().(func)
24+
# ^^^^ reference snapshot-util 0.1 advanced/decorator().wrapper().(args)
25+
# ^^^^^^ reference snapshot-util 0.1 advanced/decorator().wrapper().(kwargs)
26+
return wrapper
27+
# ^^^^^^^ reference snapshot-util 0.1 advanced/decorator().wrapper().
28+
29+
@decorator
30+
#^^^^^^^^^ reference snapshot-util 0.1 advanced/decorator().
31+
def func(x: float) -> float:
32+
# ^^^^ definition <enclosing 5, 0, 9, 15> snapshot-util 0.1 advanced/func().
33+
# documentation ```python
34+
# > @decorator
35+
# > def func(
36+
# > x: float
37+
# > ) -> float:
38+
# > ```
39+
# ^ definition snapshot-util 0.1 advanced/func().(x)
40+
# ^^^^^ reference python-stdlib 3.11 builtins/float#
41+
# external documentation ```python
42+
# > (class) float
43+
# > ```
44+
# ^^^^^ reference python-stdlib 3.11 builtins/float#
45+
test = x
46+
# ^^^^ definition local 0
47+
# documentation ```python
48+
# > builtins.float
49+
# > ```
50+
# ^ reference snapshot-util 0.1 advanced/func().(x)
51+
52+
return test
53+
# ^^^^ reference local 0
54+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# < definition scip-python python snapshot-util 0.1 simple/__init__:
2+
#documentation (module) simple
3+
4+
def simple(x):
5+
# ^^^^^^ definition <enclosing 0, 0, 1, 10> snapshot-util 0.1 simple/simple().
6+
# documentation ```python
7+
# > def simple(
8+
# > x
9+
# > ):
10+
# > ```
11+
# ^ definition snapshot-util 0.1 simple/simple().(x)
12+
return x
13+
# ^ reference snapshot-util 0.1 simple/simple().(x)
14+

packages/pyright-scip/snapshots/output/one_function/function.py

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

0 commit comments

Comments
 (0)