Michael Lazzaro:
# But I would imagine that in order to be helpful at all to p6i and QA, 
# we need to make the tests paranoid, tedious, and as encompassing as 
# possible.  There may be implementation-specific tests (like memleaks, 
# etc.) we can't help much with, but syntax and behavioral 
# issues, we can.
# 
# I think our largest goal should be to be able to organize the tests 
# exactly as the documentation is organized.  That doesn't mean anyone 
# will ever see it, other than us and the testers, but if we can 
# coordinate them as a unified effort we can (I hope) make life much 
# easier for the poor souls who will have to track down and add future 
# tests.
# 
# So from our standpoint, I would propose we simply have fields in each 
# sub*section like (?):
# 
# =test_group  general string behaviors
# 
# =test  conversion to boolean
#       ... code ...
# 
# =test  conversion from boolean
#       ... code ...
# 
# That information can then be sliced out and displayed in whatever 
# formats we need... for example, exported into /t files automatically.
# 
# Comments?

Why use POD like this instead of a more atomic version of the standard
testing format used by Perl 5?   We can use the directory structure to
organize things.  Since most tests are not worthy of inclusion in the
docs (do you really want "$foo eq reverse scalar reverse $foo" in the
documentation for reverse()?) I don't see why we can't do this.

        t/
                var/
                        scalar/
                                string/
                                        to_bool.t
                                        from_bool.t
                                        ...
                                        regress.t
                                num/
                                bool/
                                ref/
                                typed/
                                prop/
                                taint/
                        array/
                                normal/
                                sized/
                                typed/
                        hash/
                                normal/
                                restricted/
                                typed/
                        code/
                                normal/
                                        proto/
                                        vari/
                                curry/
                                anonymous/
                                        placehold/
                oper/
                        normal/
                                arithmetic.t
                                string.t
                                list.t
                                logic.t
                                junction.t
                                misc.t
                        vector/
                                arithmetic.t
                                string.t
                                list.t
                                junction.t
                                misc.t
                regex/
                        alone/
                        grammar/
                                TestGrm/
                module/
                        TestMod/
                        meta.t
                        export.t
                        globals.t
                class/
                        TestCls/
                        ...

        t/string/to_bool.t:
                use Test tests => 4;
                
                $str="This string is true!";
                ok(?$str, "True value is true");
                
                $str="0truetruetruetruetrue";
                ok(?$str, "String beginning with 0 is still true");
                
                $str="0";
                ok(?$str, "0 is false");
                
                $str="";
                ok(?$str, "Empty string is false");

This way, you can still echo the structure of the documentation, but the
tests don't clutter up the docs.

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)

Reply via email to