@@ -383,15 +383,18 @@ public void TestFunctionInstantiatedFrom()
383
383
public void TestComments ( )
384
384
{
385
385
var @class = AstContext . FindCompleteClass ( "TestComments" ) ;
386
- var commentClass = @class . Comment . FullComment . CommentToString ( CommentKind . BCPLSlash ) ;
386
+ var textGenerator = new TextGenerator ( ) ;
387
+ textGenerator . Print ( @class . Comment . FullComment , CommentKind . BCPLSlash ) ;
387
388
Assert . AreEqual ( @"/// <summary>
388
389
/// <para>Hash set/map base class.</para>
389
390
/// <para>Note that to prevent extra memory use due to vtable pointer, %HashBase intentionally does not declare a virtual destructor</para>
390
391
/// <para>and therefore %HashBase pointers should never be used.</para>
391
- /// </summary>" . Replace ( "\r " , string . Empty ) , commentClass . Replace ( "\r " , string . Empty ) ) ;
392
+ /// </summary>
393
+ " . Replace ( "\r " , string . Empty ) , textGenerator . StringBuilder . Replace ( "\r " , string . Empty ) . ToString ( ) ) ;
392
394
393
395
var method = @class . Methods . First ( m => m . Name == "GetIOHandlerControlSequence" ) ;
394
- var commentMethod = method . Comment . FullComment . CommentToString ( CommentKind . BCPL ) ;
396
+ textGenerator . StringBuilder . Clear ( ) ;
397
+ textGenerator . Print ( method . Comment . FullComment , CommentKind . BCPL ) ;
395
398
Assert . AreEqual ( @"// <summary>
396
399
// <para>Get the string that needs to be written to the debugger stdin file</para>
397
400
// <para>handle when a control character is typed.</para>
@@ -407,10 +410,12 @@ public void TestComments()
407
410
// <para>to have them do what normally would happen when using a real</para>
408
411
// <para>terminal, so this function allows GUI programs to emulate this</para>
409
412
// <para>functionality.</para>
410
- // </remarks>" . Replace ( "\r " , string . Empty ) , commentMethod . Replace ( "\r " , string . Empty ) ) ;
413
+ // </remarks>
414
+ " . Replace ( "\r " , string . Empty ) , textGenerator . StringBuilder . Replace ( "\r " , string . Empty ) . ToString ( ) ) ;
411
415
412
416
var methodTestDoxygen = @class . Methods . First ( m => m . Name == "SBAttachInfo" ) ;
413
- var commentMethodDoxygen = methodTestDoxygen . Comment . FullComment . CommentToString ( CommentKind . BCPLSlash ) ;
417
+ textGenerator . StringBuilder . Clear ( ) ;
418
+ textGenerator . Print ( methodTestDoxygen . Comment . FullComment , CommentKind . BCPLSlash ) ;
414
419
Assert . AreEqual ( @"/// <summary>Attach to a process by name.</summary>
415
420
/// <param name=""path"">A full or partial name for the process to attach to.</param>
416
421
/// <param name=""wait_for"">
@@ -420,11 +425,13 @@ public void TestComments()
420
425
/// <remarks>
421
426
/// <para>This function implies that a future call to SBTarget::Attach(...)</para>
422
427
/// <para>will be synchronous.</para>
423
- /// </remarks>" . Replace ( "\r " , string . Empty ) , commentMethodDoxygen . Replace ( "\r " , string . Empty ) ) ;
428
+ /// </remarks>
429
+ " . Replace ( "\r " , string . Empty ) , textGenerator . StringBuilder . Replace ( "\r " , string . Empty ) . ToString ( ) ) ;
424
430
425
431
var methodDoxygenCustomTags = @class . Methods . First ( m => m . Name == "glfwDestroyWindow" ) ;
426
- new CleanCommentsPass { } . VisitFull ( methodDoxygenCustomTags . Comment . FullComment ) ;
427
- var commentMethodDoxygenCustomTag = methodDoxygenCustomTags . Comment . FullComment . CommentToString ( CommentKind . BCPLSlash ) ;
432
+ new CleanCommentsPass ( ) . VisitFull ( methodDoxygenCustomTags . Comment . FullComment ) ;
433
+ textGenerator . StringBuilder . Clear ( ) ;
434
+ textGenerator . Print ( methodDoxygenCustomTags . Comment . FullComment , CommentKind . BCPLSlash ) ;
428
435
Assert . AreEqual ( @"/// <summary>Destroys the specified window and its context.</summary>
429
436
/// <param name=""window"">The window to destroy.</param>
430
437
/// <remarks>
@@ -437,7 +444,8 @@ public void TestComments()
437
444
/// <para>This function must not be called from a callback.</para>
438
445
/// <para>This function must only be called from the main thread.</para>
439
446
/// <para>Added in version 3.0. Replaces `glfwCloseWindow`.</para>
440
- /// </remarks>" . Replace ( "\r " , string . Empty ) , commentMethodDoxygenCustomTag . Replace ( "\r " , string . Empty ) ) ;
447
+ /// </remarks>
448
+ " . Replace ( "\r " , string . Empty ) , textGenerator . StringBuilder . Replace ( "\r " , string . Empty ) . ToString ( ) ) ;
441
449
}
442
450
443
451
[ Test ]
0 commit comments