[squeak-dev] The Trunk: MultilingualTests-nice.17.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Nov 1 15:00:24 UTC 2013


I don't think it would be sane to rely on this.
But even if we'd really want this feature, then it is broken by virtue of
nextChunkPut: which does honour the lineEndConvention... So we have to
change one or the other.

The main drawback of not forcing cr is that it makes it hard to compare
code thru changeList (for example recent Cuis is using LF). I can implement
other workarounds though.


2013/11/1 Levente Uzonyi <leves at elte.hu>

> I think it's intentional. The content of the chunks shouldn't be changed
> while being read. Let's say I implement #isCr: as
>
> isCr: aCharacter
>
>         ^$
>         == aCharacter
>
> By default it will return true if the argument foo is a carriage return
> character, otherwise false. But if we allow changing the line endings in
> chunks, then its behavior might be different after loading.
>
>
> Levente
>
>
> On Thu, 31 Oct 2013, commits at source.squeak.org wrote:
>
>  Nicolas Cellier uploaded a new version of MultilingualTests to project
>> The Trunk:
>> http://source.squeak.org/**trunk/MultilingualTests-nice.**17.mcz<http://source.squeak.org/trunk/MultilingualTests-nice.17.mcz>
>>
>> ==================== Summary ====================
>>
>> Name: MultilingualTests-nice.17
>> Author: nice
>> Time: 31 October 2013, 11:54:33.464 pm
>> UUID: 6de55950-5fff-43d1-9ce0-**8b661515f618
>> Ancestors: MultilingualTests-tpr.16
>>
>> Add a test showing that MultiByteFileStream>>nextChunk fails to honour
>> its own lineEndConvention.
>>
>> =============== Diff against MultilingualTests-tpr.16 ===============
>>
>> Item was added:
>> + ----- Method: MultiByteFileStreamTest>>**testLineEndingChunk (in
>> category 'testing') -----
>> + testLineEndingChunk
>> +
>> +       fileName := 'foolinend.txt'.
>> +       MultiByteFileStream forceNewFileNamed: fileName do: [ :file |
>> +               file
>> +                       wantsLineEndConversion: false;
>> +                       nextPutAll: 'line 1'; cr;
>> +                       nextPutAll: 'line 2'; crlf;
>> +                       nextPutAll: 'line 3'; lf;
>> +                       nextPutAll: 'line 4'; nextPut: $!! ].
>> +       {
>> +               {#cr.  'line 1' , String cr , 'line 2' , String cr ,
>> 'line 3' , String cr , 'line 4'}.
>> +               {#lf.  'line 1' , String cr , 'line 2' , String cr ,
>> 'line 3' , String cr , 'line 4'}.
>> +               {#crlf.  'line 1' , String cr , 'line 2' , String cr ,
>> 'line 3' , String cr , 'line 4'}.
>> +               {nil.  'line 1' , String cr , 'line 2' , String crlf ,
>> 'line 3' , String lf , 'line 4'}
>> +       } do: [:lineEndingResult |
>> +               MultiByteFileStream oldFileNamed: fileName do: [ :file |
>> +                       file lineEndConvention: lineEndingResult first.
>> +                       self assert: lineEndingResult last equals: file
>> nextChunk ] ]!
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131101/a6a62821/attachment.htm


More information about the Squeak-dev mailing list