From 0d05dae4ba093176666686dcdc2ce22d2072fc90 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 7 Feb 2024 22:30:55 +0100 Subject: [PATCH] Add more unit tests for Function List of Python --- PowerEditor/Test/FunctionList/python/unitTest | 9 +++++++++ .../Test/FunctionList/python/unitTest.expected.result | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PowerEditor/Test/FunctionList/python/unitTest b/PowerEditor/Test/FunctionList/python/unitTest index c0f621d43..46cf11e03 100644 --- a/PowerEditor/Test/FunctionList/python/unitTest +++ b/PowerEditor/Test/FunctionList/python/unitTest @@ -299,7 +299,16 @@ class SampleClassGood(object): def __init__ (self, fileName): self.fileName = fileName + def calculate_area(radius: float, pi: float = 3.14) -> float: + return pi * radius ** 2 +async def greet(name: str) -> str: + return f"Hello, {name}!" + + +def add_numbers(a: int, b: int, c: int) -> int: + return a + b + c + diff --git a/PowerEditor/Test/FunctionList/python/unitTest.expected.result b/PowerEditor/Test/FunctionList/python/unitTest.expected.result index 69192feaf..7c65fb6d7 100644 --- a/PowerEditor/Test/FunctionList/python/unitTest.expected.result +++ b/PowerEditor/Test/FunctionList/python/unitTest.expected.result @@ -1 +1 @@ -{"leaves":["dfs(G, s)","bfs(G, s)","dijk(G, s)","topo(G, ind=None, Q=[1])","adjm()","floy(A_and_n)","prim(G, s)","edglist()","krusk(E_and_n)"],"nodes":[{"leaves":["__init__ (self, fileName)"],"name":"SampleClassBad"},{"leaves":["__init__ (self, fileName)"],"name":"SampleClassGood"}],"root":"unitTest"} \ No newline at end of file +{"leaves":["dfs(G, s)","bfs(G, s)","dijk(G, s)","topo(G, ind=None, Q=[1])","adjm()","floy(A_and_n)","prim(G, s)","edglist()","krusk(E_and_n)","greet(name: str) -> str","add_numbers(a: int, b: int, c: int) -> int"],"nodes":[{"leaves":["__init__ (self, fileName)"],"name":"SampleClassBad"},{"leaves":["__init__ (self, fileName)","calculate_area(radius: float, pi: float = 3.14) -> float"],"name":"SampleClassGood"}],"root":"unitTest"} \ No newline at end of file