[Seaside-dev] undeclareds in GRSlimeTest

Philippe Marschall philippe.marschall at gmail.com
Tue Sep 10 11:38:57 UTC 2013


Hi

Johan and I were debugging why some of the GRSlimeTest fail in recent
Pharo versions. We found out that the code the tests compile contains
undeclareds. Does anybody know whether this is intentional or an
oversight? We believe it's an oversight.

The issue with #testUsesCanPerformOrUnderstand is that the code for
the 'valid' method references 'new' instead of '#new'.

The issue with #testBlockFormatting is that several times 'a' and 'b'
aren't declared as block arguments.

testUsesCanPerformOrUnderstand
    | class |
    class := self
        defineClass: #GRSlimeMockObject
        superclass: #GRObject.
    class
        compile: 'invalid1
            Object class canUnderstand: #new'
        classified: #(accessing).
    class
        compile: 'invalid2
            Object class canPerform: #new'
        classified: #(accessing).
    class
        compile: 'valid
            Object respondsTo: new'
        classified: #(accessing).
    self
        runRule: GRUsesCanPerformOrUnderstandRule
        selectors: #(invalid1 invalid2)

testBlockFormatting
    | class |
    class := self
        defineClass: #GRSlimeMockObject
        superclass: #GRObject.
    class
        compile: 'invalid1
            [a ]'
        classified: #(accessing).
    class
        compile: 'invalid2
            [:a | ]'
        classified: #(accessing).
    class
        compile: 'invalid3
            [ b]'
        classified: #(accessing).

    class
        compile: 'invalid4
            [ :a| ]'
        classified: #(accessing).
    class
        compile: 'invalid5
            [ :a |b ]'
        classified: #(accessing).
    self
        runRule: GRBlockFormattingRule
        selectors: #(invalid1 invalid2 invalid3 invalid4 invalid5)

Cheers
Philippe


More information about the seaside-dev mailing list