The Trunk: CollectionsTests-nice.200.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: CollectionsTests-nice.200.mcz

commits-2
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.200.mcz

==================== Summary ====================

Name: CollectionsTests-nice.200
Author: nice
Time: 11 March 2013, 11:40:07.355 pm
UUID: 1a65f82a-6a1c-465f-b111-72b99e08ec14
Ancestors: CollectionsTests-nice.199

Change StringTest>>testNumArgs to reflect that an empty keyword message (composed uniquely of colons $: or with a single empty key #'a::') is not a valid Smalltalk pattern (I have a doubt about previous test, was it ever valid?).

=============== Diff against CollectionsTests-nice.199 ===============

Item was changed:
  ----- Method: StringTest>>testNumArgs (in category 'testing') -----
  testNumArgs
 
  | binary punctuation |
  binary := '+-*/<=>&|,?\~@'.
  1 to: 3 do: [:length | binary combinations: length atATimeDo: [:each | self assert: each numArgs = 1]].
 
  self assert: 'foo' numArgs = 0.
  self assert: 'bar:' numArgs = 1.
  self assert: 'foo:bar:' numArgs = 2.
  self assert: 'foo2:bar1:' numArgs = 2.
 
+ self assert: '::' numArgs = -1 description: 'empty keywords are forbidden'.
- self assert: '::' numArgs = 2 description: 'empty keywords are authorized'.
 
  punctuation := '.;()[]{}"`''#$'.
  punctuation , Character separators do: [:letter | self assert: ('foo' copyWith: letter) numArgs = -1 description: 'Smalltalk punctuation and separators are illegal in a selector'].
 
  self assert: 'nextPut:andCR' numArgs = -1 description: 'terminal colon is missing'.
  self assert: 'a0:1:' numArgs = -1 description: 'a keyword cannot begin with a digit'.
  self assert: '123' numArgs = -1.
  self assert: '' numArgs = -1.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: CollectionsTests-nice.200.mcz

Frank Shearar-3
On 11 March 2013 22:40,  <[hidden email]> wrote:

> Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
> http://source.squeak.org/trunk/CollectionsTests-nice.200.mcz
>
> ==================== Summary ====================
>
> Name: CollectionsTests-nice.200
> Author: nice
> Time: 11 March 2013, 11:40:07.355 pm
> UUID: 1a65f82a-6a1c-465f-b111-72b99e08ec14
> Ancestors: CollectionsTests-nice.199
>
> Change StringTest>>testNumArgs to reflect that an empty keyword message (composed uniquely of colons $: or with a single empty key #'a::') is not a valid Smalltalk pattern (I have a doubt about previous test, was it ever valid?).

I had wondered about this. But didn't we discuss this the other day?
I'm pretty sure Yoshiki said that it _was_ valid, because it's the
"anonymous selector" in [ : a : b | a + b] (hideous whitespacing
deliberate, to show the selector).

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: CollectionsTests-nice.200.mcz

Nicolas Cellier
2013/3/11 Frank Shearar <[hidden email]>:

> On 11 March 2013 22:40,  <[hidden email]> wrote:
>> Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
>> http://source.squeak.org/trunk/CollectionsTests-nice.200.mcz
>>
>> ==================== Summary ====================
>>
>> Name: CollectionsTests-nice.200
>> Author: nice
>> Time: 11 March 2013, 11:40:07.355 pm
>> UUID: 1a65f82a-6a1c-465f-b111-72b99e08ec14
>> Ancestors: CollectionsTests-nice.199
>>
>> Change StringTest>>testNumArgs to reflect that an empty keyword message (composed uniquely of colons $: or with a single empty key #'a::') is not a valid Smalltalk pattern (I have a doubt about previous test, was it ever valid?).
>
> I had wondered about this. But didn't we discuss this the other day?
> I'm pretty sure Yoshiki said that it _was_ valid, because it's the
> "anonymous selector" in [ : a : b | a + b] (hideous whitespacing
> deliberate, to show the selector).
>
> frank
>

Well, it was pure theory...
Outside a block - and I just checked down to Squeak 2.X - the Parser
does not consider ': x' as a valid pattern.
Also these changes break other tests from Colin (whose aim seems to
burry defunct alternate syntax).

Nicolas