>
> We can't use the test egg in core.  However, there are so many hand-
> rolled assertion/test-like macros that I've often wondered if it would
> benefit us to make a simple test library part of core.  Core itself
> could benefit from an improved test suite library, and eggs wouldn't
> need an additional dependency for testing.  I don't think I want to
> literally put the test egg into core.  I like the simplicity of the API
> but the implementation is a bit messy and it's a bit hard to modify
> the way it writes its output (try changing it to output some HTML,
> for example).  This may just be a documentation problem, though.
>

I've tried to modify the way test works, too, I've concluded it's very
messy. It's not very modular, so you have to copy-paste parts of the
original and do your modifications there. It gave me the idea to write a
new test egg with the same simple API but where it somehow was easier to
modify the output like you describe.

Is your proposal to create a new test-egg-inspired test unit in core?


>
> Anyway, your test would probably succeed even if the pointer type would
> be incorrect.  It would just compile with a warning (which gets lost
> in the noise).  If you change the index to 1 or 2, it might be a better
> test since it would fail when the pointer type would be anything larger
> than a char due to the address calculation ending up somewhere beyond
> the string.  Additionally, we could compile the test with -Wall -Werror
> for example, to catch C type errors.  Would you care to write a complete
> patch to add FFI tests?  You can mail it with "git format-patch"
>

Of course, how silly of me! That should have been x[1]='B' and change input
to "AxC". Writing good tests, I guess, is always a challenge.

I could put some tests down, but I wouldn't know where to start. What would
be "complete"? Perhaps we could put this on the agenda for T-DOSE? I think
that could be fun!


> Cheers,
> Peter
> --
> http://www.more-magic.net
>
_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to