GRSlimeTest>>#run:do: question

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

GRSlimeTest>>#run:do: question

Paul DeBruicker
I'm made some Amber specific portability Slime rules using the
Grease-Slime package as a model of how-to-do-it. They are here:
http://www.squeaksource.com/AmberSlime.


In GRSlimeTest>>#run:do: After the RBSmalllintChecker runs the composite
rule it checks the validity of the results by testing

        rules
                do: [ :each |
                        self
                                assert: (rule = each or: [ each result isEmpty and: [ each changes
isEmpty ] ])
                                description: each name , ' should not report errors' ].


In Amber there aren't globals so each reference to 'Smalltalk' must be
rewritten to 'Smalltalk current'. I've written two rules that address
this: #AMSmalltalkGlobalRule & #AMSmalltalkToSmalltalkCurrentRule.

#AMSmalltalkGlobalRule compiles a list of the #references: to #Smalltalk
and #AMSmalltalkToSmalltalkCurrentRule rewrites those references if the
subsequent message send is not #current.

When running the test suite the above bit of code in #run:do: causes the
tests for  #AMSmalltalkToSmalltalkCurrentRule to fail because
#AMSmalltalkGlobalRule always has a result for the test as I've written it.

How can I rewrite the test for #AMSmalltalkToSmalltalkCurrentRule or
rule for #AMSmalltalkGlobalRule so that it doesn't raise an error when
testing another method?

I could always just remove the error checking mechanism.

Thanks in advance.

Paul
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: GRSlimeTest>>#run:do: question

Lukas Renggli
Hi Paul,

I guess this question is targeted at me, but I don't quite understand it :-)

What GRSlimeTest>>#run:do: ensures is that exactly one rule triggers
for a bogus source artifact. If your rules make some other rules to
fail, you either have to restrict your rules further or we have to
find better examples of how to test the existing rules.

Lukas

On 12 January 2012 23:47, Paul DeBruicker <[hidden email]> wrote:

> I'm made some Amber specific portability Slime rules using the Grease-Slime
> package as a model of how-to-do-it. They are here:
> http://www.squeaksource.com/AmberSlime.
>
>
> In GRSlimeTest>>#run:do: After the RBSmalllintChecker runs the composite
> rule it checks the validity of the results by testing
>
>        rules
>                do: [ :each |
>                        self
>                                assert: (rule = each or: [ each result
> isEmpty and: [ each changes isEmpty ] ])
>                                description: each name , ' should not report
> errors' ].
>
>
> In Amber there aren't globals so each reference to 'Smalltalk' must be
> rewritten to 'Smalltalk current'. I've written two rules that address this:
> #AMSmalltalkGlobalRule & #AMSmalltalkToSmalltalkCurrentRule.
>
> #AMSmalltalkGlobalRule compiles a list of the #references: to #Smalltalk and
> #AMSmalltalkToSmalltalkCurrentRule rewrites those references if the
> subsequent message send is not #current.
>
> When running the test suite the above bit of code in #run:do: causes the
> tests for  #AMSmalltalkToSmalltalkCurrentRule to fail because
> #AMSmalltalkGlobalRule always has a result for the test as I've written it.
>
> How can I rewrite the test for #AMSmalltalkToSmalltalkCurrentRule or rule
> for #AMSmalltalkGlobalRule so that it doesn't raise an error when testing
> another method?
>
> I could always just remove the error checking mechanism.
>
> Thanks in advance.
>
> Paul
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside