undeclareds in GRSlimeTest

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

undeclareds in GRSlimeTest

Philippe Marschall
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
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev