roast icon indicating copy to clipboard operation
roast copied to clipboard

The flattening behavior of the join sub is not tested

Open CIAvash opened this issue 7 years ago • 1 comments

say join ', ', <a b c>, 'd', 'e' , 'f'; OUTPUT: «a, b, c, d, e, f␤»

At first I thought that the join sub flattening everything was unexpected, because it seems to be inconsistent with the method form and other subs. But @TimToady indirectly answered my question. It seems flattening is the expected behavior.

But I did not find any tests for it.

CIAvash avatar Oct 08 '18 08:10 CIAvash

Not related to this issue specifically, how far should the tests go and how much should they cover? How much can they cover? For example should there be tests for subs that don't flatten to make sure they are not flattening? Or is that redundant? Because an implementation can pass the tests yet have unexpected behaviors.

I'm asking this because if the tests are not detailed, the only way to document some aspects of Perl 6 is by looking at the implementation(Rakudo ATM).

CIAvash avatar Oct 08 '18 08:10 CIAvash