From fad747300a70509fbdfa7a2c0d7afcaaea3fa33a Mon Sep 17 00:00:00 2001 From: Don HO Date: Fri, 28 Aug 2020 00:18:19 +0200 Subject: [PATCH] Update python unit-tests files --- PowerEditor/Test/FunctionList/python/unitTest | 27 ++++++++++++++++++- .../python/unitTest.expected.result | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/PowerEditor/Test/FunctionList/python/unitTest b/PowerEditor/Test/FunctionList/python/unitTest index 1fd6e5ce2..bd36ab500 100644 --- a/PowerEditor/Test/FunctionList/python/unitTest +++ b/PowerEditor/Test/FunctionList/python/unitTest @@ -1,3 +1,28 @@ +INPUT_FILE_NAME = "example.txt" + +class SampleClassBad (object): + # WrongClassName: this will appear in the function list + + def __init__ (self, fileName): + self.fileName = fileName + + +class SampleClassGood(object): + # this works as expected: notice the missing space between + # the class name and the left parenthesis. + + def __init__ (self, fileName): + self.fileName = fileName + + +def main(): + sampleBad = SampleClassBad (INPUT_FILE_NAME) + sampleGood = SampleClassGood (INPUT_FILE_NAME) + +if __name__ == '__main__': + main() + + from __future__ import print_function try: @@ -277,4 +302,4 @@ def krusk(E_and_n): break s[j].update(s[i]) s.pop(i) - break \ No newline at end of file + break diff --git a/PowerEditor/Test/FunctionList/python/unitTest.expected.result b/PowerEditor/Test/FunctionList/python/unitTest.expected.result index 6e1c5822b..b26b7f384 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)"],"root":"unitTest"} \ No newline at end of file +{"leaves":["main()","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