use v6; use Test; use ABC::Grammar; { my $match = ABC::Grammar.parse(slurp("samples.abc"), :rule); ok $match, 'samples.abc is a valid tune file'; is @( $match ).elems, 3, "Three tunes were found"; my @titles = @( $match ).flatmap({ @( .
).grep({ . eq "T" })[0] }).flatmap({ . }); is +@titles, 3, "Three titles were found"; is @titles[0], "Cuckold Come Out o' the Amrey", "First is Cuckold"; is @titles[1], "Elsie Marley", "Second is Elsie Marley"; is @titles[2], "Peacock Followed the Hen. JWDM.07", "Third is Peacock"; } done-testing;