How many methods in a class

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

How many methods in a class

Klaus Breker-2
Hello all,

how many methods (instance side) can be defined for class in VASmalltalk? I plan to generate SUnit tests for some strings. One test for every string.

Regards

Klaus

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How many methods in a class

dmacq
Hi Klaus,

I have never heard of there being a hard limit.  If you inspect a class, you will see the the class's methods are instances of CompiledMethod objects stored in a Array called methodsArray. This array will grow automatically as needed.

Personally I would find one test per string too restrictive, and might combine several string tests in one method, but Smalltalk doesn't care.

testSomeStrings

self assert: ('str' = STR asLowercase).
self assert: ('STR' = 'str' asUppercase)

and so on.

Donald [|]


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How many methods in a class

Klaus Breker-2
Hi Donald,

thank you for the reply. I have at least 15000 strings for NLS. In one method this will be at least 15001 lines.
I think I' ll store the strings in an external file and read them during testing

Regards

Klaus

Am Dienstag, 23. Mai 2017 22:10:12 UTC+2 schrieb Donald MacQueen:
Hi Klaus,

I have never heard of there being a hard limit.  If you inspect a class, you will see the the class's methods are instances of CompiledMethod objects stored in a Array called methodsArray. This array will grow automatically as needed.

Personally I would find one test per string too restrictive, and might combine several string tests in one method, but Smalltalk doesn't care.

testSomeStrings

self assert: ('str' = STR asLowercase).
self assert: ('STR' = 'str' asUppercase)

and so on.

Donald [|]


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How many methods in a class

dmacq
In reply to this post by Klaus Breker-2
Hi Klaus,

That is what I would do. It keeps things simple which is always good.

Donald [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.