[squeak-dev] Displaying SUnit tests/results in a Seaside App.

gettimothy gettimothy at zoho.com
Fri Apr 24 17:32:04 UTC 2020


Hi Folks,



I am writing a ton of tests for my parser grammar, and since the test results are xHTML, I thought it would be useful to display the tests and the output in a Seaside app.



I searched the Seaside forum for this and did not see anything, so I am posting this here as it might be a useful tool for Squeak/Pharo in general (someday)





I doubt it is doable, but here goes:



Here is a test from my current work:



testLinkExternal



<timeout: 10>

"LinkExternal	 					<- OPEN_BRACKET  s URLPrefix .{SpaceCaption}	"



|input xmlElement actor ios|



actor := PEGWikiMediaGeneratorTables new.

actor transcripton: false.

      input := '[http://www.wikipedia.org Named]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="http://www.wikipedia.org">Named</a>') .



      input := '[https://www.wikipedia.org  DUDE]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="https://www.wikipedia.org">DUDE</a>') .



      input := '[mailto:mailto:somebody at somewhere.com]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="mailto:mailto:somebody at somewhere.com">mailto:mailto:somebody at somewhere.com</a>') .



      input := '[irc://something]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="irc://something">irc://something</a>') .



      input := '[ircs://something]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="ircs://something">ircs://something</a>') .



      input := '[ftp://something.org]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="ftp://something.org">ftp://something.org</a>') .



      input := '[news://emacs.org]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="news://emacs.org">news://emacs.org</a>') .



      input := '[gopher://what.is.a.gopher.address]'.  

xmlElement := parser parse: 'LinkExternal' stream: input reading actor: actor.

ios := xmlElement printString.

self assert: ((ios contents) = '<a href="gopher://what.is.a.gopher.address">gopher://what.is.a.gopher.address</a>') .





Thinking out loud, I would like to see the test name, its status, upon clicking it, the value of "input" and "ios contents" displayed on the web page.



Pretty weird, huh?



Feel free to shoot-it-down if it is ugly. (:



cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200424/21f0712c/attachment.html>


More information about the Squeak-dev mailing list