summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/uasyncio_threadsafeflag.py20
-rw-r--r--tests/extmod/uasyncio_threadsafeflag.py.exp11
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/extmod/uasyncio_threadsafeflag.py b/tests/extmod/uasyncio_threadsafeflag.py
index 4e002a3d2a..a8a08d2e92 100644
--- a/tests/extmod/uasyncio_threadsafeflag.py
+++ b/tests/extmod/uasyncio_threadsafeflag.py
@@ -75,5 +75,25 @@ async def main():
print("wait task")
await t
+ # Flag set, cleared, and set again.
+ print("----")
+ print("set event")
+ flag.set()
+ print("yield")
+ await asyncio.sleep(0)
+ print("clear event")
+ flag.clear()
+ print("yield")
+ await asyncio.sleep(0)
+ t = asyncio.create_task(task(4, flag))
+ print("yield")
+ await asyncio.sleep(0)
+ print("set event")
+ flag.set()
+ print("yield")
+ await asyncio.sleep(0)
+ print("wait task")
+ await t
+
asyncio.run(main())
diff --git a/tests/extmod/uasyncio_threadsafeflag.py.exp b/tests/extmod/uasyncio_threadsafeflag.py.exp
index aef4e479ba..757115ac4b 100644
--- a/tests/extmod/uasyncio_threadsafeflag.py.exp
+++ b/tests/extmod/uasyncio_threadsafeflag.py.exp
@@ -19,3 +19,14 @@ yield
task 3
task 3 done
wait task
+----
+set event
+yield
+clear event
+yield
+yield
+task 4
+set event
+yield
+wait task
+task 4 done