> I need to test some private routines, so is there a way to do that?

Is there a downsize to augment for this?

# source
class Dog {
    method bark { say( "#bark"); return "bark" }
    method !pee { say( "#pee" ); return "pee"}

# test 

use Test;
use v6;
plan 4;

my Dog $t;

ok( Dog.bark eq  "bark", "Good loud Dog" );
ok( $t.bark eq  "bark", "Good loud dog" );

augment class Dog {     # augment should be a test
    # do private tests in private 
     ok( Dog!pee eq "pee", "Good bad Dog" );
     ok( $t!pee eq "pee", "Good bad dog" );

Reply via email to