Help language development. Donate to The Perl Foundation

CSS::Properties zef:dwarring last updated on 2022-09-29

t/00-readme.t
use Test;
plan 12;

my $read-me = "README.md".IO.slurp;

$read-me ~~ /^ $<waffle>=.*? +%% ["```" \n? $<code>=.*? "```" \n?] $/
    or die "README.md parse failed";

for @<code> {
    my $snippet = ~$_;
    # unless this looks like css
    unless $snippet ~~ /^ ['@font-face' | 'margin-top:'] / {
        # disable say
        sub say(|c) { }
        quietly {
            lives-ok {EVAL $snippet}, 'code sample'
                or die "eval error: $snippet";
        }
    }
}

done-testing;