Page 1 of 1

'of' removed from class name in test block

PostPosted: Wed Apr 09, 2008 4:47 pm
by khjklujn
mono 1.2.6 and windows, cobra svn-post-0.7.4 rev 1460

Looks like any occurrence of 'of' in a class name is getting stripped out when the test method is generated. C# compilation of the following code complains about not knowing what 'Abcdef' is.
class Abcofdef
test
Abcofdef()

Re: 'of' removed from class name in test block

PostPosted: Wed Apr 09, 2008 9:28 pm
by Charles
I could actually see the line of code that was the culprit when I read your message, which was a neat experience. But of course, the first step is to recreate the problem which I'm having a problem doing. This works fine for me:
class Abcofdef
test
Abcofdef()
def init
print 'Oh, hi!'
def main is shared
pass

Of course, it's silly that in the C# code the "of" is removed, but before I fix, I'd like a test case that breaks hard. I'm also on revision 1460 and I did a fresh "comp".

Can you provide a complete, breaking example?

Re: 'of' removed from class name in test block

PostPosted: Thu Apr 10, 2008 6:21 pm
by khjklujn
I simplified the example a little too much. Use 't = Abcofdef()' in the test instead of 'Abcofdef()'. On my machine, the resulting code in the test block contains an 'Abcdef t = null;' line.

Also, compiling the original with the -test option will produce an error because the class it tries to execute the test off of is Abcdef (sorry about leaving that part out--I've gotten in the habit of using the test block as a substitute for main in quick and dirty stuff).

Re: 'of' removed from class name in test block

PostPosted: Thu Apr 10, 2008 7:14 pm
by Charles
Fixed.