On Feb 17, 2013, at 19:48 , Marvin Humphrey <[email protected]> wrote:

> For a number of reasons, Clownfish needs an immutable string type, which I
> think should be named Clownfish::String.  CharBuf would become a mutable
> subclass of String (and would be significantly rarer than it is now).

Oh, I'd love to help working on this. One thing I don't like about the current 
CharBuf implementation is that the way to iterate through strings is rather 
limiting. The highlighter code in particular could benefit from a few changes.

> How about CSTR_EQ for C strings and STR_EQ for CharBufs (and eventually,
> Clownfish::Strings)?
> 
> IMO, claiming primacy for CharBufs over C strings is already justified based
> on stats:
> 
>    $ grep -pir "cb_equals\b" core/Lucy/Test/ | wc -l
>          58
>    $ grep -pir "cb_equals_str\b" core/Lucy/Test/ | wc -l
>          42
>    $ grep -pir "str_eq\b" core/Lucy/Test/ | wc -l
>           3
> 
> Or alternatively, can we punt and define the three test macros you enumerate
> above in Lucy::Test but not Clownfish::Test?

+1 for punting the decision, then.

> I'd thought the printf-style would have been taken advantage of more often,
> but on inspection I think there were 4 usages total between the Charmonizer
> test suite and the Lucy test suite.  I'm a little surprised that you actually
> used it more in CFC's tests.

That's interesting. I used the printf style about 35 times in the CFC tests:

    $ grep '%' clownfish/compiler/src/CFCTest[A-Z]*.c |grep -v sprintf |wc -l
          35

It's probably due to the nature of the CFC tests where a lot of stuff is tested 
in 'for' loops.

> Hmm, I hope the give-and-take of consensus building hasn't been too
> demotivating. :\

No, not at all.

> If it's just coding fatigue, though, then congratulations on
> getting a huge amount done before burning out.  I'm happy to do some work on
> this area, and we might be able to queue up some easy issues as well for
> newcomers looking to get involved.

Refactoring and porting tests is simply boring stuff and I have done a lot of 
that lately.

> We might consider looking to xUnit once again for inspiration and
> encapsulating the list of TestBatches within a TestSuite -- but that's
> something we could tackle down the road.

OK, then I continue the work I started in 'clownfish-test-v2'.

To recap, there seems to be consensus on the following items:

    * Use the following macros locally in the Lucy tests:
        * OK
        * INT_EQ
        * FLOAT_EQ
        * STR_EQ
        * CB_EQ
        * CB_EQ_STR
    * Store the current test batch in a global variable so we can
      do away with the first macro argument.

WRT the printf-style messages, I'd simply keep them.

Nick

Reply via email to