@@ -383,15 +383,18 @@ public void TestFunctionInstantiatedFrom()
383383 public void TestComments ( )
384384 {
385385 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 ) ;
387388 Assert . AreEqual ( @"/// <summary>
388389/// <para>Hash set/map base class.</para>
389390/// <para>Note that to prevent extra memory use due to vtable pointer, %HashBase intentionally does not declare a virtual destructor</para>
390391/// <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 ( ) ) ;
392394
393395 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 ) ;
395398 Assert . AreEqual ( @"// <summary>
396399// <para>Get the string that needs to be written to the debugger stdin file</para>
397400// <para>handle when a control character is typed.</para>
@@ -407,10 +410,12 @@ public void TestComments()
407410// <para>to have them do what normally would happen when using a real</para>
408411// <para>terminal, so this function allows GUI programs to emulate this</para>
409412// <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 ( ) ) ;
411415
412416 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 ) ;
414419 Assert . AreEqual ( @"/// <summary>Attach to a process by name.</summary>
415420/// <param name=""path"">A full or partial name for the process to attach to.</param>
416421/// <param name=""wait_for"">
@@ -420,11 +425,13 @@ public void TestComments()
420425/// <remarks>
421426/// <para>This function implies that a future call to SBTarget::Attach(...)</para>
422427/// <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 ( ) ) ;
424430
425431 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 ) ;
428435 Assert . AreEqual ( @"/// <summary>Destroys the specified window and its context.</summary>
429436/// <param name=""window"">The window to destroy.</param>
430437/// <remarks>
@@ -437,7 +444,8 @@ public void TestComments()
437444/// <para>This function must not be called from a callback.</para>
438445/// <para>This function must only be called from the main thread.</para>
439446/// <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 ( ) ) ;
441449 }
442450
443451 [ Test ]
0 commit comments