[Pharo-project] various issue related to test
i am writting double link list and co, then a few test. i found it will be neat to reuse the linked list test. this one is trait based. I found the following issue preventing reussability: - when i subclass linked list test with trait, i get the trait test but not the test from linked list test, i expected to get these ones as well - when i sublcass without trait i get the test from linked list test but not the trait ones, i guess this is an expected behavior - when i subclass without trait then reimplement some of the test, i only got the those test exexuted, not the one from super. how do you deal with such situation? -- http://blog.ofset.org/hilaire
Hilaire if you want to reuse the trait created a TestCase subclass: uses: put the trait here. have a look at OrderedCollectionTest for example. On Jan 13, 2009, at 4:34 PM, Hilaire Fernandes wrote:
i am writting double link list and co, then a few test.
i found it will be neat to reuse the linked list test. this one is trait based.
I found the following issue preventing reussability:
- when i subclass linked list test with trait,
I do not understand what you mean above.
i get the trait test but not the test from linked list test, i expected to get these ones as well - when i sublcass without trait i get the test from linked list test but not the trait ones, i guess this is an expected behavior - when i subclass without trait then reimplement some of the test, i only got the those test exexuted, not the one from super.
how do you deal with such situation?
check if the superclass is abstract when a test case class implement isAbstract ^ self name = #name of the class then your tests on the class are not executed but they are in the subclasses. stef
-- http://blog.ofset.org/hilaire
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi Hilaire, There is probably something I missed in your email.
- when i subclass linked list test with trait, i get the trait test but not the test from linked list test, i expected to get these ones as well
DoubleLinkedListTest run: #testTAdd => 1 run, 1 passes, 0 expected failures, 0 failures, 0 errors, 0 unexpected passes LinkedList overrides testTAdd of TAddTest Printing: LinkedListTest compile: 'testFoo ^ true' DoubleLinkedListTest run: #testFoo => 1 run, 1 passes, 0 expected failures, 0 failures, 0 errors, 0 unexpected passes I do not understand what you said.
- when i sublcass without trait i get the test from linked list test but not the trait ones, i guess this is an expected behavior
If a class A uses a trait T, then a subclass of A should also get the methods of T.
- when i subclass without trait then reimplement some of the test, i only got the those test exexuted, not the one from super.
how do you deal with such situation?
Can you provide an example? This remains obscure to me. Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
2009/1/13 Alexandre Bergel <alexandre@bergel.eu>:
Hi Hilaire,
There is probably something I missed in your email.
May be my explanation, getting exhausted today.
- when i subclass linked list test with trait, i get the trait test but not the test from linked list test, i expected to get these ones as well
I mean when I subclass + add the same trait found in the super class. Logically I can expect the test from superclass to be accessible, but only those coming from the trait are runned by the test tool.
- when i subclass without trait then reimplement some of the test, i only got the those test exexuted, not the one from super.
Okay Stephan explain that Hilaire
participants (3)
-
Alexandre Bergel -
Hilaire Fernandes -
Stéphane Ducasse