mirror of
https://github.com/LiteyukiStudio/magicoca.git
synced 2024-11-23 00:57:37 +08:00
✨ 新增select语句
This commit is contained in:
parent
4975b19a24
commit
efa55473ff
@ -5,22 +5,22 @@ from magicoca import Chan, select
|
|||||||
|
|
||||||
def sp1(chan: Chan[int]):
|
def sp1(chan: Chan[int]):
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
chan << i
|
chan << i << i * 2
|
||||||
|
|
||||||
|
|
||||||
def sp2(chan: Chan[int]):
|
def sp2(chan: Chan[int]):
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
chan << i
|
chan << i << i * 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def rp(chans: list[Chan[int]]):
|
def rp(chans: list[Chan[int]]):
|
||||||
rl = []
|
rl = []
|
||||||
for t in select(*chans):
|
for t in select(*chans):
|
||||||
rl.append(t)
|
rl.append(t)
|
||||||
if len(rl) == 20:
|
if len(rl) == 40:
|
||||||
break
|
break
|
||||||
print(rl)
|
print(rl)
|
||||||
assert len(rl) == 20
|
|
||||||
|
|
||||||
|
|
||||||
class TestSelect:
|
class TestSelect:
|
||||||
|
Loading…
Reference in New Issue
Block a user