[squeak-dev] The Trunk: KernelTests-cbc.336.mcz
Eliot Miranda
eliot.miranda at gmail.com
Sun Mar 25 22:56:18 UTC 2018
Hi Chris,
On Sun, Mar 25, 2018 at 1:51 PM, <commits at source.squeak.org> wrote:
> Chris Cunningham uploaded a new version of KernelTests to project The
> Trunk:
> http://source.squeak.org/trunk/KernelTests-cbc.336.mcz
>
> ==================== Summary ====================
>
> Name: KernelTests-cbc.336
> Author: cbc
> Time: 25 March 2018, 1:51:33.345291 pm
> UUID: 6e6b91ac-d706-8f4d-bd60-1057109994cb
> Ancestors: KernelTests-eem.335
>
> Test that new xor: takes blocks - but only those that result in booleans.
> Others raise errors.
>
> =============== Diff against KernelTests-eem.335 ===============
>
> Item was changed:
> ----- Method: FalseTest>>testXor (in category 'tests') -----
> testXor
> self assert: (false xor: true) = true.
> self assert: (false xor: false) = false.
> + self assert: (false xor: [true]) = true.
> + self assert: (false xor: [false]) = false.
> + self should: [false xor: [1]] raise: NonBooleanReceiver.!
>
Shouldn't "false xor: 1" also raise an error? I don't see why "false xor:
[1]" should raise NonBooleanReceiver specifically. It should raise an
error, but whether [1] or 1 becomes the receiver internally to xor: seems
to me an implementation detail. Surely the receiver in "false xor: [1]" is
false and that ids a boolean, so NonBooleanReceiver is an unintuitive error
for me :-)
> -
> - self
> - should: [(false xor: [false])
> - ifTrue: ["This should never be true, do not signal
> an Error and let the test fail"]
> - ifFalse: [self error: 'OK, this should be false,
> raise an Error']]
> - raise: Error
> - description: 'a Block argument is not allowed. If it were,
> answer would be false'.!
>
> Item was changed:
> ----- Method: TrueTest>>testXor (in category 'testing') -----
> testXor
> self assert: (true xor: true) = false.
> self assert: (true xor: false) = true.
> + self assert: (true xor: [true]) = false.
> + self assert: (true xor: [false]) = true.
> + self should: [true xor: [1]] raise: NonBooleanReceiver.!
> -
> - self
> - should: [(true xor: [true])
> - ifTrue: ["This should never be true, do not signal
> an Error and let the test fail"]
> - ifFalse: [self error: 'OK, this should be false,
> raise an Error']]
> - raise: Error
> - description: 'a Block argument is not allowed. If it were,
> answer would be false'.!
>
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180325/a49fb4fc/attachment.html>
More information about the Squeak-dev
mailing list
|