[squeak-dev] The Trunk: CollectionsTests-nice.223.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Sep 19 21:28:41 UTC 2014


Never mind, I've got an error about a connection timeout, thus retried, but
it seems like it was superfluous...

2014-09-19 23:18 GMT+02:00 <commits at source.squeak.org>:

> Nicolas Cellier uploaded a new version of CollectionsTests to project The
> Trunk:
> http://source.squeak.org/trunk/CollectionsTests-nice.223.mcz
>
> ==================== Summary ====================
>
> Name: CollectionsTests-nice.223
> Author: nice
> Time: 19 September 2014, 11:15:20.772 pm
> UUID: f1a61e56-790b-457a-95fe-b3e149a460fb
> Ancestors: CollectionsTests-nice.222
>
> Add some tests for sort functions support
>
> =============== Diff against CollectionsTests-nice.222 ===============
>
> Item was added:
> + TestCase subclass: #ChainedSortFunctionTest
> +       instanceVariableNames: ''
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'CollectionsTests-Support'!
>
> Item was added:
> + ----- Method: ChainedSortFunctionTest>>testEvaluation (in category
> 'tests') -----
> + testEvaluation
> +
> +       | function |
> +       function := #first ascending , [:a | a at: 2] descending , #last
> ascending.
> +       "first different"
> +       self assert: (function value: #(1 2 3) value: #(2 2 3)).
> +       self deny: (function value: #(3 2 3) value: #(2 2 3)).
> +       "first the same"
> +       self assert: (function value: #(1 2 3) value: #(1 1 3)).
> +       self assert: (function value: #(1 2 2) value: #(1 1 3)).
> +       self assert: (function value: #(1 2 3) value: #(1 1 2)).
> +       self deny: (function value: #(1 2 3) value: #(1 3 3)).
> +       self deny: (function value: #(1 2 2) value: #(1 3 3)).
> +       self deny: (function value: #(1 2 3) value: #(1 3 2)).
> +       "first and second the same"
> +       self assert: (function value: #(1 2 3) value: #(1 2 3)).
> +       self assert: (function value: #(1 2 2) value: #(1 2 3)).
> +       self deny: (function value: #(1 2 4) value: #(1 2 3))!
>
> Item was added:
> + TestCase subclass: #SortFunctionTest
> +       instanceVariableNames: ''
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'CollectionsTests-Support'!
>
> Item was added:
> + ----- Method: SortFunctionTest>>testDirectionToggling (in category
> 'tests') -----
> + testDirectionToggling
> +
> +       | function |
> +       function := #x ascending.
> +       self assert: (function value: 0 @ 2 value: 1 @ 1).
> +       self assert: (function value: 1 @ 2 value: 1 @ 1).
> +       self deny: (function value: 2 @ 2 value: 1 @ 1).
> +       function toggleDirection.
> +       self deny: (function value: 1 @ 2 value: 2 @ 1).
> +       self assert: (function value: 1 @ 2 value: 1 @ 1).
> +       self assert: (function value: 2 @ 2 value: 1 @ 1).
> +       function toggleDirection.
> +       self assert: (function value: 0 @ 2 value: 1 @ 1).
> +       self assert: (function value: 1 @ 2 value: 1 @ 1).
> +       self deny: (function value: 2 @ 2 value: 1 @ 1)!
>
> Item was added:
> + ----- Method: SortFunctionTest>>testSingleArgBlock (in category 'tests')
> -----
> + testSingleArgBlock
> +
> +       | function block |
> +       block := [:point | point x / point y].
> +       function := block ascending.
> +       self assert: (function value: 0 @ 2 value: 1 @ 1).
> +       self assert: (function value: 1 @ 2 value: 2 @ 4).
> +       self deny: (function value: 2 @ 2 value: 1 @ 2).
> +       function := block descending.
> +       self deny: (function value: 1 @ 2 value: 2 @ 1).
> +       self assert: (function value: 2 @ 2 value: 1 @ 1).
> +       self assert: (function value: 3 @ 2 value: 1 @ 1)!
>
> Item was added:
> + ----- Method: SortFunctionTest>>testTwoArgBlock (in category 'tests')
> -----
> + testTwoArgBlock
> +
> +       | function block |
> +       block :=
> +                       [:a :b |
> +                       a odd = b odd ifTrue: [0] ifFalse: [a odd ifTrue:
> [-1] ifFalse: [1]]].
> +       function := block ascending.
> +       self assert: (function value: 2 value: 4).
> +       self assert: (function value: 1 value: 3).
> +       self assert: (function value: 1 value: 4).
> +       self deny: (function value: -2 value: 1).
> +       function := block descending.
> +       self assert: (function value: 2 value: 4).
> +       self assert: (function value: 1 value: 3).
> +       self deny: (function value: 1 value: 4).
> +       self assert: (function value: -2 value: 1)!
>
> Item was added:
> + ----- Method: SortFunctionTest>>testUnarySymbol (in category 'tests')
> -----
> + testUnarySymbol
> +
> +       | function |
> +       function := #x ascending.
> +       self assert: (function value: 0 @ 2 value: 1 @ 1).
> +       self assert: (function value: 1 @ 2 value: 1 @ 1).
> +       self deny: (function value: 2 @ 2 value: 1 @ 1).
> +       function := #x descending.
> +       self deny: (function value: 1 @ 2 value: 2 @ 1).
> +       self assert: (function value: 1 @ 2 value: 1 @ 1).
> +       self assert: (function value: 2 @ 2 value: 1 @ 1)!
>
> Item was added:
> + TestCase subclass: #TestSpaceshipOperator
> +       instanceVariableNames: ''
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'CollectionsTests-Support'!
>
> Item was added:
> + ----- Method: TestSpaceshipOperator>>testFloats (in category 'tests')
> -----
> + testFloats
> +
> +       | a b c d |
> +       a := 13.1.
> +       b := 18.9.
> +       c := 18.9.
> +       d := -7.2.
> +       self assert: (b <=> c) isZero.
> +       self assert: a <=> b = -1.
> +       self assert: b <=> a = 1.
> +       self assert: a <=> d = 1.
> +       self assert: d <=> a = -1!
>
> Item was added:
> + ----- Method: TestSpaceshipOperator>>testStrings (in category 'tests')
> -----
> + testStrings
> +
> +       | a b c d |
> +       a := 'xc'.
> +       b := 'xd'.
> +       c := 'xd'.
> +       d := 'xa'.
> +       self assert: (b <=> c) isZero.
> +       self assert: a <=> b = -1.
> +       self assert: b <=> a = 1.
> +       self assert: a <=> d = 1.
> +       self assert: d <=> a = -1!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140919/ee799845/attachment.htm


More information about the Squeak-dev mailing list