Forums

'of' removed from class name in test block

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

'of' removed from class name in test block

Postby khjklujn » Wed Apr 09, 2008 4:47 pm

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()
khjklujn
 
Posts: 29

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

Postby Charles » Wed Apr 09, 2008 9:28 pm

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?
Charles
 
Posts: 2510
Location: Los Angeles, CA

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

Postby khjklujn » Thu Apr 10, 2008 6:21 pm

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).
khjklujn
 
Posts: 29

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

Postby Charles » Thu Apr 10, 2008 7:14 pm

Fixed.
Charles
 
Posts: 2510
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron