tcwebidldefs.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. unit tcwebidldefs;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils, fpcunit, testregistry, webidldefs;
  6. Type
  7. { TTestDefinition }
  8. TTestDefinition = Class(TTestCase)
  9. private
  10. FDef: TIDLDefinition;
  11. function CreateUnionTypeDef(Types : Array of UTF8String; withAttrs: Boolean=False): TIDLUnionTypeDefDefinition;
  12. function CreateArgument(isOptional : Boolean; DefaultValue : string = ''; withAttrs: Boolean=False): TIDLArgumentDefinition;
  13. function CreateFunction(Options: TFunctionOptions; Args: Array of UTF8String; withAttrs: Boolean=False): TIDLFunctionDefinition;
  14. function CreateAttribute(Options: TAttributeOptions; withAttrs: Boolean=False): TIDLAttributeDefinition;
  15. function CreateConst(withAttrs: Boolean=False): TIDLConstDefinition;
  16. function CreateImplements(Const ATypeName : String; withAttrs: Boolean=False): TIDLImplementsDefinition;
  17. function CreateIncludes(Const ATypeName : String; withAttrs: Boolean=False): TIDLIncludesDefinition;
  18. function CreateTypeDef(Const ATypeName : String; withAttrs: Boolean=False): TIDLTypeDefDefinition;
  19. function CreateInterface(Const AParentName : String; aMembers : Array of TIDLDefinition; withAttrs: Boolean=False): TIDLInterfaceDefinition;
  20. function CreateDictionaryMember(Const AName,aTypeName,aDefault : String; aRequired : Boolean; withAttrs: Boolean=False): TIDLDictionaryMemberDefinition;
  21. function CreateDictionary(Const AParentName : String; aMembers : Array of TIDLDictionaryMemberDefinition; withAttrs: Boolean=False): TIDLDictionaryDefinition;
  22. function CreateSequence(Const AElementName : String; withAttrs: Boolean=False): TIDLSequenceTypeDefDefinition;
  23. function CreatePromise(Const AReturnTypeName: String; withAttrs: Boolean=False): TIDLPromiseTypeDefDefinition;
  24. function CreateSetLike(Const AElementName: String; withAttrs: Boolean=False): TIDLSetLikeDefinition;
  25. function CreateMapLike(Const AKeyTypeName,AValueTypeName: String; withAttrs: Boolean=False): TIDLMapLikeDefinition;
  26. function CreateRecord(Const AKeyTypeName,AValueTypeName: String; withAttrs: Boolean=False): TIDLRecordDefinition;
  27. Public
  28. Procedure TearDown; override;
  29. function CreateDef(aClass: TIDLDefinitionClass; WithAttrs: Boolean=False): TIDLDefinition;
  30. Procedure TestDef(Const aDef : String; AFull : Boolean);
  31. Property Def : TIDLDefinition Read FDef Write FDef;
  32. published
  33. Procedure TestConst;
  34. procedure TestAttribute;
  35. procedure TestStringifierAttribute;
  36. procedure TestStringifierFunction;
  37. procedure TestFunction;
  38. procedure TestCallBackFunction;
  39. procedure TestArgument;
  40. procedure TestImplements;
  41. procedure TestIncludes;
  42. procedure TestTypeDef;
  43. procedure TestUnionTypeDef;
  44. procedure TestInterface;
  45. procedure TestDictionaryMember;
  46. procedure TestDictionary;
  47. procedure TestCallbackInterface;
  48. procedure TestSequence;
  49. procedure TestPromise;
  50. procedure TestMapLike;
  51. procedure TestSetLike;
  52. procedure TestRecord;
  53. end;
  54. implementation
  55. { TTestDefinition }
  56. procedure TTestDefinition.TearDown;
  57. begin
  58. FreeAndNil(FDef);
  59. inherited TearDown;
  60. end;
  61. function TTestDefinition.CreateDef(aClass: TIDLDefinitionClass; WithAttrs : Boolean = False): TIDLDefinition;
  62. begin
  63. FreeAndNil(FDef);
  64. FDef:=aClass.Create(Nil,'A','test1.webidl',1,1);
  65. if WithAttrs then
  66. FDef.Attributes.Add('Me');
  67. Result:=FDef;
  68. end;
  69. procedure TTestDefinition.TestDef(const aDef: String; AFull: Boolean);
  70. begin
  71. AssertEquals('Def '+FDef.ClassName +'.AsString('+BoolToStr(aFull,'True','False')+')',ADef,FDef.AsString(afull));
  72. end;
  73. function TTestDefinition.CreateConst(withAttrs: Boolean): TIDLConstDefinition;
  74. begin
  75. Result:=CreateDef(TIDLConstDefinition,WithAttrs) as TIDLConstDefinition;
  76. Result.TypeName:='short';
  77. Result.Value:='0x8080';
  78. end;
  79. function TTestDefinition.CreateImplements(const ATypeName: String;
  80. withAttrs: Boolean): TIDLImplementsDefinition;
  81. begin
  82. Result:=CreateDef(TIDLImplementsDefinition,WithAttrs) as TIDLImplementsDefinition;
  83. Result.ImplementedInterface:=ATypeName;
  84. end;
  85. function TTestDefinition.CreateIncludes(const ATypeName: String;
  86. withAttrs: Boolean): TIDLIncludesDefinition;
  87. begin
  88. Result:=CreateDef(TIDLIncludesDefinition,WithAttrs) as TIDLIncludesDefinition;
  89. Result.IncludedInterface:=ATypeName;
  90. end;
  91. function TTestDefinition.CreateTypeDef(const ATypeName: String;
  92. withAttrs: Boolean): TIDLTypeDefDefinition;
  93. begin
  94. Result:=CreateDef(TIDLTypeDefDefinition,WithAttrs) as TIDLTypeDefDefinition;
  95. Result.TypeName:=ATypeName;
  96. end;
  97. function TTestDefinition.CreateInterface(const AParentName: String;
  98. aMembers: array of TIDLDefinition; withAttrs: Boolean
  99. ): TIDLInterfaceDefinition;
  100. Var
  101. M : TIDLDefinition;
  102. begin
  103. Result:=CreateDef(TIDLInterfaceDefinition,WithAttrs) as TIDLInterfaceDefinition;
  104. Result.ParentName:=AParentName;
  105. For M in aMembers do
  106. Result.members.Add(M);
  107. end;
  108. function TTestDefinition.CreateDictionaryMember(const AName, aTypeName,
  109. aDefault: String; aRequired: Boolean; withAttrs: Boolean
  110. ): TIDLDictionaryMemberDefinition;
  111. begin
  112. Result:=CreateDef(TIDLDictionaryMemberDefinition,WithAttrs) as TIDLDictionaryMemberDefinition;
  113. Result.Name:=aName;
  114. Result.MemberType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  115. Result.MemberType.TypeName:=aTypeName;
  116. Result.IsRequired:=aRequired;
  117. if (aDefault<>'') then
  118. begin
  119. Result.DefaultValue:=TIDLConstDefinition.Create(Result,'','test1.webidl',1,1);
  120. Result.DefaultValue.Value:=aDefault;
  121. end;
  122. end;
  123. function TTestDefinition.CreateDictionary(const AParentName: String;
  124. aMembers: array of TIDLDictionaryMemberDefinition; withAttrs: Boolean
  125. ): TIDLDictionaryDefinition;
  126. Var
  127. M : TIDLDictionaryMemberDefinition;
  128. begin
  129. Result:=CreateDef(TIDLDictionaryDefinition,WithAttrs) as TIDLDictionaryDefinition;
  130. Result.ParentName:=aParentName;
  131. for M in aMembers do
  132. Result.Members.Add(M);
  133. end;
  134. function TTestDefinition.CreateSequence(const AElementName: String;
  135. withAttrs: Boolean): TIDLSequenceTypeDefDefinition;
  136. begin
  137. Result:=CreateDef(TIDLSequenceTypeDefDefinition,WithAttrs) as TIDLSequenceTypeDefDefinition;
  138. Result.ElementType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  139. Result.ElementType.TypeName:=AElementName;
  140. end;
  141. function TTestDefinition.CreatePromise(const AReturnTypeName: String;
  142. withAttrs: Boolean): TIDLPromiseTypeDefDefinition;
  143. begin
  144. Result:=CreateDef(TIDLPromiseTypeDefDefinition,withAttrs) as TIDLPromiseTypeDefDefinition;
  145. Result.ReturnType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  146. Result.ReturnType.TypeName:=AReturnTypeName;
  147. end;
  148. function TTestDefinition.CreateSetLike(const AElementName: String;
  149. withAttrs: Boolean): TIDLSetLikeDefinition;
  150. begin
  151. Result:=CreateDef(TIDLSetLikeDefinition,WithAttrs) as TIDLSetLikeDefinition;
  152. Result.ElementType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  153. Result.ElementType.TypeName:=AElementName;
  154. end;
  155. function TTestDefinition.CreateMapLike(const AKeyTypeName,
  156. AValueTypeName: String; withAttrs: Boolean): TIDLMapLikeDefinition;
  157. begin
  158. Result:=CreateDef(TIDLMapLikeDefinition,WithAttrs) as TIDLMapLikeDefinition;
  159. Result.KeyType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  160. Result.KeyType.TypeName:=AKeyTypeName;
  161. Result.ValueType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  162. Result.ValueType.TypeName:=AValueTypeName;
  163. end;
  164. function TTestDefinition.CreateRecord(const AKeyTypeName,
  165. AValueTypeName: String; withAttrs: Boolean): TIDLRecordDefinition;
  166. begin
  167. Result:=CreateDef(TIDLRecordDefinition,WithAttrs) as TIDLRecordDefinition;
  168. Result.KeyType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  169. Result.KeyType.TypeName:=AKeyTypeName;
  170. Result.ValueType:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  171. Result.ValueType.TypeName:=AValueTypeName;
  172. end;
  173. procedure TTestDefinition.TestConst;
  174. begin
  175. CreateConst(False);
  176. TestDef('const short A 0x8080',true);
  177. TestDef('short A 0x8080',False);
  178. CreateConst(True);
  179. TestDef('[Me] const short A 0x8080',true);
  180. TestDef('short A 0x8080',False);
  181. end;
  182. function TTestDefinition.CreateUnionTypeDef(Types: array of UTF8String;
  183. withAttrs: Boolean): TIDLUnionTypeDefDefinition;
  184. Var
  185. S : UTF8String;
  186. T : TIDLTypeDefDefinition;
  187. begin
  188. Result:=CreateDef(TIDLUnionTypeDefDefinition,WithAttrs) as TIDLUnionTypeDefDefinition;
  189. for S in Types do
  190. begin
  191. T:=TIDLTypeDefDefinition.Create(Result,'','test1.webidl',1,1);
  192. T.TypeName:=S;
  193. Result.Union.Add(T);
  194. end;
  195. end;
  196. function TTestDefinition.CreateArgument(isOptional: Boolean; DefaultValue: string; withAttrs: Boolean): TIDLArgumentDefinition;
  197. begin
  198. Result:=CreateDef(TIDLArgumentDefinition,WithAttrs) as TIDLArgumentDefinition;
  199. Result.ArgumentType:=TIDLTypeDefDefinition.Create(Result,'AN','test1.webidl',1,1);
  200. Result.ArgumentType.TypeName:='short';
  201. Result.HasDefaultValue:=(DefaultValue<>'');
  202. Result.DefaultValue:=DefaultValue;
  203. Result.IsOptional:=IsOptional;
  204. end;
  205. function TTestDefinition.CreateFunction(Options: TFunctionOptions; Args: array of UTF8String; withAttrs: Boolean): TIDLFunctionDefinition;
  206. Var
  207. I : integer;
  208. begin
  209. Result:=CreateDef(TIDLFunctionDefinition,WithAttrs) as TIDLFunctionDefinition;
  210. Result.ReturnType:=TIDLTypeDefDefinition.Create(Result,'AN','test1.webidl',1,1);
  211. Result.ReturnType.TypeName:='short';
  212. Result.Options:=Options;
  213. I:=0;
  214. While I<Length(Args)-1 do
  215. begin
  216. Result.Arguments.Add(TIDLArgumentDefinition,args[I+1],'test1.webidl',1,1);
  217. Result.Argument[I div 2].ArgumentType:=TIDLTypeDefDefinition.Create(Result,'AN'+IntToStr(i),'test1.webidl',1,1);
  218. Result.Argument[I div 2].ArgumentType.TypeName:=args[i];
  219. // With Result.Argument[I div 2] do
  220. // Writeln(I,': ',Name+'->',ArgumentType.TypeName);
  221. Inc(I,2);
  222. end;
  223. end;
  224. function TTestDefinition.CreateAttribute(Options: TAttributeOptions;
  225. withAttrs: Boolean): TIDLAttributeDefinition;
  226. begin
  227. Result:=CreateDef(TIDLAttributeDefinition,WithAttrs) as TIDLAttributeDefinition;
  228. Result.AttributeType:=TIDLTypeDefDefinition.Create(Result,'AN','test1.webidl',1,1);
  229. Result.AttributeType.TypeName:='short';
  230. Result.Options:=Options;
  231. end;
  232. procedure TTestDefinition.TestAttribute;
  233. begin
  234. CreateAttribute([],False);
  235. TestDef('attribute short A',true);
  236. TestDef('short A',False);
  237. CreateAttribute([],True);
  238. TestDef('[Me] attribute short A',true);
  239. TestDef('short A',False);
  240. CreateAttribute([aoReadonly],false);
  241. TestDef('readonly attribute short A',true);
  242. TestDef('short A',False);
  243. CreateAttribute([aoStatic],false);
  244. TestDef('static attribute short A',true);
  245. TestDef('short A',False);
  246. end;
  247. procedure TTestDefinition.TestStringifierAttribute;
  248. begin
  249. CreateAttribute([aoStringifier],false);
  250. TestDef('stringifier attribute short A',true);
  251. TestDef('short A',False);
  252. CreateAttribute([aoStringifier,aoReadOnly],false);
  253. TestDef('stringifier readonly attribute short A',true);
  254. TestDef('short A',False);
  255. end;
  256. procedure TTestDefinition.TestStringifierFunction;
  257. begin
  258. CreateFunction([foStringifier],[],False);
  259. TestDef('stringifier short A ()',True);
  260. end;
  261. procedure TTestDefinition.TestFunction;
  262. Var
  263. F : TIDLFunctionDefinition;
  264. begin
  265. CreateFunction([],[],False);
  266. TestDef('short A ()',True);
  267. CreateFunction([],['short','B'],False);
  268. TestDef('short A (short B)',True);
  269. TestDef('short A (short B)',False);
  270. CreateFunction([],['short','B'],True);
  271. TestDef('[Me] short A (short B)',True);
  272. F:=CreateFunction([],['short','B','long','C'],False);
  273. F.Argument[1].IsOptional:=True;
  274. TestDef('short A (short B, optional long C)',True);
  275. F.Argument[1].HasDefaultValue:=True;
  276. F.Argument[1].DefaultValue:='123';
  277. TestDef('short A (short B, optional long C = 123)',True);
  278. CreateFunction([foStatic],[],False);
  279. TestDef('static short A ()',True);
  280. CreateFunction([foGetter],[],False);
  281. TestDef('getter short A ()',True);
  282. CreateFunction([foSetter],[],False);
  283. TestDef('setter short A ()',True);
  284. end;
  285. procedure TTestDefinition.TestCallBackFunction;
  286. begin
  287. CreateFunction([foCallback],[],False);
  288. TestDef('callback A = short ()',True);
  289. end;
  290. procedure TTestDefinition.TestArgument;
  291. begin
  292. CreateArgument(False,'',False);
  293. TestDef('short A',true);
  294. CreateArgument(False,'',False).ArgumentType.AllowNull:=True;
  295. TestDef('short? A',true);
  296. CreateArgument(true,'',False);
  297. TestDef('optional short A',true);
  298. CreateArgument(true,'',true);
  299. TestDef('[Me] optional short A',true);
  300. CreateArgument(true,'1',true);
  301. TestDef('[Me] optional short A = 1',true);
  302. end;
  303. procedure TTestDefinition.TestImplements;
  304. begin
  305. CreateImplements('IME',False);
  306. TestDef('A implements IME',False);
  307. TestDef('A implements IME',True);
  308. CreateImplements('IME',True);
  309. TestDef('A implements IME',False);
  310. TestDef('[Me] A implements IME',True);
  311. end;
  312. procedure TTestDefinition.TestIncludes;
  313. begin
  314. CreateIncludes('IME',False);
  315. TestDef('A includes IME',False);
  316. TestDef('A includes IME',True);
  317. CreateIncludes('IME',True);
  318. TestDef('A includes IME',False);
  319. TestDef('[Me] A includes IME',True);
  320. end;
  321. procedure TTestDefinition.TestTypeDef;
  322. begin
  323. CreateTypeDef('IME',False);
  324. TestDef('IME',False);
  325. TestDef('typedef IME A',true);
  326. CreateTypeDef('IME',True);
  327. TestDef('IME',False);
  328. TestDef('[Me] typedef IME A',true);
  329. CreateTypeDef('IME',True).AllowNull:=True;
  330. TestDef('IME?',False);
  331. TestDef('[Me] typedef IME? A',true);
  332. end;
  333. procedure TTestDefinition.TestUnionTypeDef;
  334. begin
  335. CreateUnionTypeDef(['string','short'],False);
  336. TestDef('(string or short)',False);
  337. TestDef('typedef (string or short) A',true);
  338. CreateUnionTypeDef(['string','short','unsigned long long'],true);
  339. TestDef('(string or short or unsigned long long)',False);
  340. TestDef('[Me] typedef (string or short or unsigned long long) A',true);
  341. end;
  342. procedure TTestDefinition.TestInterface;
  343. Var
  344. C : TIDLConstDefinition;
  345. D : TIDLFunctionDefinition;
  346. begin
  347. CreateInterface('',[],False);
  348. TestDef('interface A {'+sLinebreak+'}',True);
  349. CreateInterface('B',[]);
  350. TestDef('interface A : B {'+sLinebreak+'}',True);
  351. C:=CreateConst(False);
  352. Def:=Nil;
  353. CreateInterface('B',[C]);
  354. TestDef('interface A : B {'+sLinebreak+' const short A 0x8080;'+sLineBreak+'}',True);
  355. C:=CreateConst(False);
  356. C.Name:='D';
  357. Def:=Nil;
  358. D:=CreateFunction([],[],True);
  359. D.Name:='C';
  360. Def:=Nil;
  361. CreateInterface('B',[C,D]);
  362. TestDef('interface A : B {'+sLinebreak
  363. +' const short D 0x8080;'+sLineBreak
  364. +' [Me] short C ();'+sLineBreak
  365. +'}',True);
  366. CreateInterface('',[],False).IsPartial:=True;
  367. TestDef('partial interface A {'+sLinebreak+'}',True);
  368. end;
  369. procedure TTestDefinition.TestDictionaryMember;
  370. begin
  371. CreateDictionaryMember('A','short','',False,False);
  372. TestDef('short A',False);
  373. TestDef('short A',True);
  374. CreateDictionaryMember('A','short','""',False,False);
  375. TestDef('short A = ""',False);
  376. TestDef('short A = ""',True);
  377. CreateDictionaryMember('A','short','',True,False);
  378. TestDef('required short A',False);
  379. TestDef('required short A',True);
  380. CreateDictionaryMember('A','short','',False,True);
  381. TestDef('short A',False);
  382. TestDef('[Me] short A',True);
  383. CreateDictionaryMember('A','short','',true,True);
  384. TestDef('required short A',False);
  385. TestDef('[Me] required short A',True);
  386. end;
  387. procedure TTestDefinition.TestDictionary;
  388. Var
  389. m1,m2 : TIDLDictionaryMemberDefinition;
  390. begin
  391. CreateDictionary('',[],False);
  392. TestDef('dictionary A {'+sLinebreak+'}',True);
  393. CreateDictionary('B',[],False);
  394. TestDef('dictionary A : B {'+sLinebreak+'}',True);
  395. m1:=CreateDictionaryMember('B','short','',False,False);
  396. Def:=Nil;
  397. CreateDictionary('',[m1],False);
  398. TestDef('dictionary A {'+sLinebreak+
  399. ' short B;'+sLinebreak+
  400. '}',True);
  401. m1:=CreateDictionaryMember('C','short','',False,False);
  402. Def:=Nil;
  403. m2:=CreateDictionaryMember('D','short','',true,True);
  404. Def:=Nil;
  405. CreateDictionary('B',[m1,m2],False);
  406. TestDef('dictionary A : B {'+sLinebreak+
  407. ' short C;'+sLinebreak+
  408. ' [Me] required short D;'+sLinebreak+
  409. '}',True);
  410. end;
  411. procedure TTestDefinition.TestCallbackInterface;
  412. begin
  413. CreateInterface('',[],False).IsCallBack:=True;
  414. TestDef('callback interface A {'+sLinebreak+'}',True);
  415. end;
  416. procedure TTestDefinition.TestSequence;
  417. begin
  418. CreateSequence('short',false);
  419. TestDef('typedef sequence <short> A',True);
  420. TestDef('sequence <short>',False);
  421. CreateSequence('short',True);
  422. TestDef('[Me] typedef sequence <short> A',True);
  423. TestDef('sequence <short>',False);
  424. end;
  425. procedure TTestDefinition.TestPromise;
  426. begin
  427. CreatePromise('short',false);
  428. TestDef('typedef promise <short> A',True);
  429. TestDef('promise <short>',False);
  430. CreatePromise('short',true);
  431. TestDef('[Me] typedef promise <short> A',True);
  432. TestDef('promise <short>',False);
  433. CreatePromise('short',False).AllowNull:=True;
  434. TestDef('typedef promise <short>? A',True);
  435. TestDef('promise <short>?',False);
  436. end;
  437. procedure TTestDefinition.TestMapLike;
  438. begin
  439. CreateMapLike('short','string',false);
  440. TestDef('maplike <short,string>',True);
  441. TestDef('maplike <short,string>',False);
  442. CreateMapLike('short','string', True);
  443. TestDef('[Me] maplike <short,string>',True);
  444. TestDef('maplike <short,string>',False);
  445. CreateMapLike('short','string' ,false).IsReadOnly:=True;
  446. TestDef('readonly maplike <short,string>',True);
  447. TestDef('readonly maplike <short,string>',False);
  448. end;
  449. procedure TTestDefinition.TestSetLike;
  450. begin
  451. CreateSetLike('string',false);
  452. TestDef('setlike <string>',True);
  453. TestDef('setlike <string>',False);
  454. CreateSetLike('string', True);
  455. TestDef('[Me] setlike <string>',True);
  456. TestDef('setlike <string>',False);
  457. CreateSetLike('string' ,false).IsReadOnly:=True;
  458. TestDef('readonly setlike <string>',True);
  459. TestDef('readonly setlike <string>',False);
  460. end;
  461. procedure TTestDefinition.TestRecord;
  462. begin
  463. CreateRecord('short','string',false);
  464. TestDef('typedef record <short,string>',True);
  465. TestDef('record <short,string>',False);
  466. CreateRecord('short','string', True);
  467. TestDef('[Me] typedef record <short,string>',True);
  468. TestDef('record <short,string>',False);
  469. end;
  470. initialization
  471. RegisterTests([TTestDefinition])
  472. end.