[Seaside-dev] portability round 3, that's all for today

Paolo Bonzini bonzini at gnu.org
Thu Feb 14 20:58:54 UTC 2008


>>  And here are some problems I found:
>>
>>  1) WAHtmlRootTest>>#testLinkElementWithContent fails on GNU Smalltalk
>>  and it should give '<title></title><style
>>  type="text/css">/*<![CDATA[*/body { margin: 0pt; padding:
>>  0pt;}/*]]>*/</style>'.  It is not in the list that Lukas sent to me of
>>  tests failing in Squeak -- how come it passes there?
> 
> Are you sure you use the latest version, the code looks ok to me at first glane

I am using Seaside-Core-lr.48.mcz.st and Seaside-Tests-pmm.20.mcz.st

>>  3) The #sourceCodeAt: check from WAFileLibrary fails in GNU Smalltalk
>>  for complicated reasons; it does not add to the testcase in my opinion,
>>  can you zap it?
> 
> I'd rather make sure this stuff really works. What are the reasons
> besides newlines?

#sourceCodeAt: returns the source code with brackets around the method 
body.  The similar test for ByteArrays doesn't check the source code 
because Squeak does not have #[].

>>  6) Why does WAResponse>>#nextPutAll: use #do: instead of just doing
>>  "stream nextPutAll: aString"?
> 
> I have to guess here, because #nextPut: sends #asCharacter to an
> object with suggested type character. You can create WAResponses on
> Strings and ByteArrays. Don't get me started on the duality of
> Smalltalk Streams.

I see.  The problem I have is that 255 asCharacter creates a 
UnicodeCharacter on GST.  On the other hand, in GST the stream 
transparently accepts Strings and ByteArrays for #nextPutAll:.

It's not a problem, I can override the method locally since I know it 
will work for my dialect.

>>  8) Where do I get WADispatcherFiles which are needed by the tests?
> 
> Where is it needed? Do you use the latest version?

In WADocumentHandler:

     createAndVerifyBinaryDocumentNamed: aFilename hasAttachement: 
aHttpHeaderValue
         self
             createAndVerifyDocumentNamed: aFilename
             content: WADispatcherFiles default logoPng
             mimeType: 'image/jpeg'
             hasAttachement: aHttpHeaderValue

     createAndVerifyTextDocumentNamed: aFilename hasAttachement: 
aHttpHeaderValue
         self
             createAndVerifyDocumentNamed: aFilename
             content: WADispatcherFiles default mainCss
             mimeType: 'text/css'
             hasAttachement: aHttpHeaderValue

and in WAFileLibraryTest:

     testFilenames
         | expected actual |
         expected := #(#editorCss #topJpg #mainCss #savePng).
         actual := WADispatcherFiles new fileSelectors.
         "VW does not implement #= in Sets"
         self assert: actual size = expected size.
         expected do: [:each | self assert: (expected includes: each)]

Thanks!

Paolo


More information about the seaside-dev mailing list