Mercurial > hg > orthanc-stone
annotate Resources/CodeGeneration/stonegentool_test.py @ 486:8e40355a172b bgo-commands-codegen
Unit tests OK for preambles, enums and structs in both TS and C++
author | bgo-osimis |
---|---|
date | Fri, 15 Feb 2019 14:30:26 +0100 |
parents | 772516adcbf6 |
children | f6b7f113cf27 |
rev | line source |
---|---|
474 | 1 from stonegentool import \ |
2 EatToken,SplitListOfTypes,ParseTemplateType,LoadSchema,CheckSchemaSchema,ProcessSchema | |
471 | 3 import unittest |
473 | 4 import os |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
5 import re |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
6 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
7 def RemoveDateTimeLine(s : str): |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
8 # regex are non-multiline by default, and $ does NOT match the end of the line |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
9 s2 = re.sub(r"^// autogenerated by stonegentool on .*\n","",s) |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
10 return s2 |
471 | 11 |
12 class TestStonegentool(unittest.TestCase): | |
13 def test_EatToken_empty(self): | |
14 c = r"" | |
15 a,b = EatToken(c) | |
16 self.assertEqual(a,r"") | |
17 self.assertEqual(b,r"") | |
18 | |
19 def test_EatToken_simpleNonTemplate(self): | |
20 c = r"int32" | |
21 a,b = EatToken(c) | |
22 self.assertEqual(a,r"int32") | |
23 self.assertEqual(b,r"") | |
24 | |
25 def test_EatToken_simpleTemplate(self): | |
26 c = r"vector<string>" | |
27 a,b = EatToken(c) | |
28 self.assertEqual(a,r"vector<string>") | |
29 self.assertEqual(b,r"") | |
30 | |
31 def test_EatToken_complexTemplate(self): | |
32 c = r"vector<map<int64,string>>,vector<map<int32,string>>" | |
33 a,b = EatToken(c) | |
34 self.assertEqual(a,r"vector<map<int64,string>>") | |
35 self.assertEqual(b,r"vector<map<int32,string>>") | |
36 | |
472 | 37 def test_EatToken_complexTemplates(self): |
471 | 38 c = r"vector<map<vector<string>,map<int32,string>>>,map<int32,string>,map<map<int32,string>,string>" |
39 a,b = EatToken(c) | |
40 self.assertEqual(a,r"vector<map<vector<string>,map<int32,string>>>") | |
41 self.assertEqual(b,r"map<int32,string>,map<map<int32,string>,string>") | |
42 a,b = EatToken(b) | |
43 self.assertEqual(a,r"map<int32,string>") | |
44 self.assertEqual(b,r"map<map<int32,string>,string>") | |
45 | |
473 | 46 def test_SplitListOfTypes(self): |
47 c = r"vector<map<vector<string>,map<int32,string>>>,map<int32,string>,map<map<int32,string>,string>" | |
48 lot = SplitListOfTypes(c) | |
49 self.assertEqual(3,len(lot)) | |
50 self.assertEqual("vector<map<vector<string>,map<int32,string>>>",lot[0]) | |
51 self.assertEqual("map<int32,string>",lot[1]) | |
52 self.assertEqual("map<map<int32,string>,string>",lot[2]) | |
53 | |
54 def test_SplitListOfTypes_bogus(self): | |
55 c = r"vector<map<vector<string>,map<int32,string>>,map<int32,string>,map<map<int32,string>,string" | |
56 self.assertRaises(Exception,SplitListOfTypes,c) # the argument c must be passed to assertRaises, not as a normal call of SplitListOfTypes | |
57 | |
58 def test_ParseTemplateType_true(self): | |
59 c = "map<vector<map<int,vector<string>>>,map<vector<int>,vector<string>>>" | |
60 (ok,a,b) = ParseTemplateType(c) | |
61 self.assertEqual(ok,True) | |
62 self.assertEqual(a,"map") | |
63 self.assertEqual(b,["vector<map<int,vector<string>>>","map<vector<int>,vector<string>>"]) | |
64 | |
65 (ok2,a2,b2) = ParseTemplateType(b[0]) | |
66 self.assertEqual(ok2,True) | |
67 self.assertEqual(a2,"vector") | |
68 self.assertEqual(b2,["map<int,vector<string>>"]) | |
69 | |
70 (ok3,a3,b3) = ParseTemplateType(b[1]) | |
71 self.assertEqual(ok3,True) | |
72 self.assertEqual(a3,"map") | |
73 self.assertEqual(b3,["vector<int>","vector<string>"]) | |
74 | |
75 (ok4,a4,b4) = ParseTemplateType(b2[0]) | |
76 self.assertEqual(ok4,True) | |
77 self.assertEqual(a4,"map") | |
78 self.assertEqual(b4,["int","vector<string>"]) | |
79 | |
80 def test_ParseSchema(self): | |
81 fn = os.path.join(os.path.dirname(__file__), 'test', 'test1.jsonc') | |
82 obj = LoadSchema(fn) | |
83 # we're happy if it does not crash | |
84 CheckSchemaSchema(obj) | |
85 | |
86 def test_ParseSchema_bogus_json(self): | |
87 fn = os.path.join(os.path.dirname(__file__), 'test', 'test1_bogus_json.jsonc') | |
88 self.assertRaises(Exception,LoadSchema,fn) | |
89 | |
90 def test_ParseSchema_bogus_schema(self): | |
91 fn = os.path.join(os.path.dirname(__file__), 'test', 'test1_bogus_schema.jsonc') | |
92 obj = LoadSchema(fn) | |
93 self.assertRaises(Exception,CheckSchemaSchema,obj) | |
94 | |
474 | 95 def test_GenOrderQueue(self): |
96 fn = os.path.join(os.path.dirname(__file__), 'test', 'test1.jsonc') | |
97 obj = LoadSchema(fn) | |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
98 genOrderQueue:str |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
99 _, _, genOrderQueue = ProcessSchema(obj) |
482
f58fe38c8c04
Ongoing work on codegen: ts and cpp enum and struct writing seem to be OK. No file write yet
bgo-osimis
parents:
474
diff
changeset
|
100 self.assertEqual(3,len(genOrderQueue)) |
f58fe38c8c04
Ongoing work on codegen: ts and cpp enum and struct writing seem to be OK. No file write yet
bgo-osimis
parents:
474
diff
changeset
|
101 self.assertEqual("A",genOrderQueue[0]) |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
102 self.assertEqual("B",genOrderQueue[1]) |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
103 self.assertEqual("C",genOrderQueue[2]) |
473 | 104 |
474 | 105 def test_GenerateTypeScriptEnumeration(self): |
482
f58fe38c8c04
Ongoing work on codegen: ts and cpp enum and struct writing seem to be OK. No file write yet
bgo-osimis
parents:
474
diff
changeset
|
106 fn = os.path.join(os.path.dirname(__file__), 'test', 'test1.jsonc') |
f58fe38c8c04
Ongoing work on codegen: ts and cpp enum and struct writing seem to be OK. No file write yet
bgo-osimis
parents:
474
diff
changeset
|
107 obj = LoadSchema(fn) |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
108 (_,outputStreams,_) = ProcessSchema(obj) |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
109 |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
110 tsPreambleRef: str = "// autogenerated by stonegentool on Fri Feb 15 07:36:51 2019\n" |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
111 tsEnumsRef: str = """enum MovieType |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
112 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
113 Romcom, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
114 Horror, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
115 ScienceFiction, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
116 Vegetables |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
117 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
118 |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
119 enum CrispType |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
120 { |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
121 SaltAndPepper, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
122 CreamAndChives, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
123 Paprika, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
124 Barbecue |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
125 }; |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
126 |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
127 """ |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
128 |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
129 tsStructsRef: str = """class A |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
130 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
131 public Array<string> someStrings; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
132 public Array<number> someInts2; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
133 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
134 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
135 class B |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
136 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
137 public Array<A> someAs; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
138 public Array<number> someInts; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
139 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
140 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
141 class C |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
142 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
143 public Array<B> someBs; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
144 public Array<D> ddd; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
145 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
146 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
147 """ |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
148 |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
149 tsPreambleRefCastrated: str = RemoveDateTimeLine(tsPreambleRef) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
150 tsPreambleCastrated: str = RemoveDateTimeLine(outputStreams.tsPreamble.getvalue()) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
151 self.assertEqual(tsPreambleRefCastrated,tsPreambleCastrated) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
152 self.assertEqual(tsEnumsRef,outputStreams.tsEnums.getvalue()) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
153 self.assertEqual(tsStructsRef,outputStreams.tsStructs.getvalue()) |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
154 |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
155 cppPreambleRef: str = """// autogenerated by stonegentool on Fri Feb 15 07:36:51 2019 |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
156 #include <cstdint> |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
157 #include <string> |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
158 #include <vector> |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
159 #include <map> |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
160 |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
161 """ |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
162 |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
163 cppEnumsRef: str = """enum MovieType |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
164 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
165 Romcom, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
166 Horror, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
167 ScienceFiction, |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
168 Vegetables |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
169 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
170 |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
171 enum CrispType |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
172 { |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
173 SaltAndPepper, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
174 CreamAndChives, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
175 Paprika, |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
176 Barbecue |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
177 }; |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
178 |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
179 """ |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
180 cppStructsRef: str = """struct A |
485
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
181 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
182 std::vector<string> someStrings; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
183 std::vector<int32_t> someInts2; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
184 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
185 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
186 struct B |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
187 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
188 std::vector<A> someAs; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
189 std::vector<int32_t> someInts; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
190 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
191 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
192 struct C |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
193 { |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
194 std::vector<B> someBs; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
195 std::vector<D> ddd; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
196 }; |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
197 |
772516adcbf6
Ongoing work on code generation. Enums and structs OK in ts and cpp
bgo-osimis
parents:
482
diff
changeset
|
198 """ |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
199 cppPreambleRefCastrated: str = RemoveDateTimeLine(cppPreambleRef) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
200 cppPreambleCastrated: str = RemoveDateTimeLine(outputStreams.cppPreamble.getvalue()) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
201 self.assertEqual(cppPreambleRefCastrated,cppPreambleCastrated) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
202 self.assertEqual(cppEnumsRef,outputStreams.cppEnums.getvalue()) |
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
203 self.assertEqual(cppStructsRef,outputStreams.cppStructs.getvalue()) |
473 | 204 |
474 | 205 def test_GenerateCppEnumeration(self): |
206 pass | |
207 | |
208 def test_GenerateTypeScriptClasses(self): | |
209 pass | |
210 | |
211 def test_GenerateCppClasses(self): | |
212 pass | |
213 | |
214 def test_GenerateTypeScriptHandlerInterface(self): | |
215 pass | |
216 | |
217 def test_GenerateCppHandlerInterface(self): | |
218 pass | |
219 | |
220 def test_GenerateTypeScriptDispatcher(self): | |
221 pass | |
222 | |
223 def test_GenerateCppDispatcher(self): | |
224 pass | |
473 | 225 |
472 | 226 # def test(self): |
471 | 227 # s = 'hello world' |
228 # self.assertEqual(s.split(), ['hello', 'world']) | |
229 # # check that s.split fails when the separator is not a string | |
230 # with self.assertRaises(TypeError): | |
231 # s.split(2) | |
232 | |
233 if __name__ == '__main__': | |
474 | 234 unittest.main() |
486
8e40355a172b
Unit tests OK for preambles, enums and structs in both TS and C++
bgo-osimis
parents:
485
diff
changeset
|
235 |