--- Begin Message ---Hi, In a fresh pharo 6 image, I add a class with an instance variable x and implement accessors. Then I write a test method for the accessors of x MyClassTest>>testReadWriteX self assert (MyClass new x: 0) x equals: 0I run the test and obviously it is green BUT I remove the instance variable x. Obviously, the accessors are broken and the test should be red when I execute it again but it is not!!! I can even change the class again (to recompile it I thought) or even load the code in a new image and the tests are still green. I can also invoque the broken methods in a playground or in an inspector : MyClass new x: 0; increment; x then printIt. and astonishingly 1 is printed. The only way to detect the error is to recompile the method but this does not happen (maybe it should) when instance variables are modified or removed in the class (even when you use the refactoring tool!) I think this is annoying because one can no more really trust his tests. Cheers Abdelghani
--- End Message ---
[Pharo-users] Removing instance variables doesn't recompile the methods
abdelghani ALIDRA via Pharo-users Sun, 26 Nov 2017 12:09:36 -0800
- [Pharo-users] Removing instance variable... abdelghani ALIDRA via Pharo-users
- Re: [Pharo-users] Removing instance... Stephane Ducasse
- Re: [Pharo-users] Removing inst... Stephane Ducasse
- Re: [Pharo-users] Removing instance... Ben Coman
- Re: [Pharo-users] Removing inst... Peter Uhnák
- Re: [Pharo-users] Removing instance... abdelghani ALIDRA via Pharo-users
- Re: [Pharo-users] Removing instance... abdelghani ALIDRA via Pharo-users