Permalink
Browse files

move/rename test grammars SS::Aural::Grammar -> t::CSS::Aural::Gramma…

…r, etc

latest rakudo doesn't seem to cope with generating to added 't' lib path.
  • Loading branch information...
dwarring committed Dec 24, 2016
1 parent 0e72195 commit 9d9b6e977d34c8c2c923d05a977d33532128059f
View
@@ -3,3 +3,5 @@
*.o
*~
#*
lib/.precomp
View
@@ -1,3 +1,4 @@
0.4.3 Move test classes into lib path; t::CSS::Aural::Grammar, etc.
0.4.2 Bugfix a length can be a percentage quantity
- Also reinstate t/terms.t, lost around 538f043
0.4.1 Output a specific unit for zero quantities.
View
@@ -1,7 +1,7 @@
{ "perl" : "6.c",
"name" : "CSS::Specification",
"version" : "0.4.2",
"description" : "CSS Property definition grammar and tools",
"version" : "0.4.3",
"description" : "CSS Property definition grammar and generation tools",
"depends" : [ "CSS::Grammar" ],
"source-url" : "git://github.com/p6-css/perl6-CSS-Specification.git",
"provides" : {
@@ -1,14 +1,14 @@
use v6;
use CSS::Aural::Spec::Actions;
use CSS::Grammar::Actions;
use t::CSS::Aural::Spec::Actions;
use t::CSS::Aural::Spec::Interface;
use CSS::Specification::Terms::Actions;
use CSS::Aural::Spec::Interface;
use CSS::Grammar::Actions;
class CSS::Aural::Actions
is CSS::Aural::Spec::Actions
class t::CSS::Aural::Actions
is t::CSS::Aural::Spec::Actions
is CSS::Specification::Terms::Actions
is CSS::Grammar::Actions
does CSS::Aural::Spec::Interface {
does t::CSS::Aural::Spec::Interface {
method proforma:sym<inherit>($/) { make {'keyw' => ~$<sym>} }
}
@@ -0,0 +1,12 @@
use v6;
use t::CSS::Aural::Spec::Grammar;
use CSS::Grammar::CSS21;
use t::CSS::Aural::Spec::Interface;
grammar t::CSS::Aural::BadGrammar
is t::CSS::Aural::Spec::Grammar
is CSS::Grammar::CSS21
does t::CSS::Aural::Spec::Interface {
# this grammar doesn't provide interface methods - should fail at compilation, e.g.:
# "Method 'generic-voice' must be implemented by t::CSS::Aural::BadGrammar because it is required by a role"
}
View
@@ -0,0 +1,14 @@
use t::CSS::Aural::Spec::Grammar;
use t::CSS::Aural::Spec::Interface;
use CSS::Specification::Terms;
use CSS::Grammar::CSS21;
grammar t::CSS::Aural::Grammar
is t::CSS::Aural::Spec::Grammar
is CSS::Specification::Terms
is CSS::Grammar::CSS21
does t::CSS::Aural::Spec::Interface {
rule proforma:sym<inherit> { <sym> }
}
@@ -2,7 +2,7 @@ use v6;
# -- DO NOT EDIT --
# generated by: t/build.t
class CSS::Aural::Spec::Actions {
class t::CSS::Aural::Spec::Actions {
method expr-cue-after($/) { make $.list($/) }
method expr-cue-before($/) { make $.list($/) }
method generic-voice($/) { make $.rule($/) }
@@ -2,7 +2,7 @@ use v6;
# -- DO NOT EDIT --
# generated by: t/build.t
grammar CSS::Aural::Spec::Grammar {
grammar t::CSS::Aural::Spec::Grammar {
#| azimuth: <angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards
rule decl:sym<azimuth> {:i (azimuth) ':' <val( rx{ <expr=.expr-azimuth> }, &?ROUTINE.WHY)> }
@@ -1,7 +1,7 @@
use v6;
# -- DO NOT EDIT --
# generated by: t/build.t
role CSS::Aural::Spec::Interface {
role t::CSS::Aural::Spec::Interface {
method angle($/) { ... }
method color($/) { ... }
method frequency($/) { ... }
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,14 +1,12 @@
#!/usr/bin/env perl6
use lib 't';
use Test;
use CSS::Grammar::Test;
use CSS::Specification::Build;
sub pipe($input-path, $code, $output-path?) {
sub capture($code, $output-path?) {
my $output;
my $*IN = open $input-path, :r;
my $*OUT = $output-path
?? open $output-path, :w
!! class {
@@ -23,7 +21,7 @@ sub pipe($input-path, $code, $output-path?) {
return $output-path // $output;
}
my $base-name = 'CSS::Aural::Spec';
my $base-name = 't::CSS::Aural::Spec';
my $grammar-name = $base-name ~ '::Grammar';
my $actions-name = $base-name ~ '::Actions';
my $interface-name = $base-name ~ '::Interface';
@@ -33,30 +31,30 @@ my @summary = CSS::Specification::Build::summary( :$input-path );
is +@summary, 25, 'number of summary items';
is-deeply [@summary.grep({ .<box> })], [{:box, :!inherit, :name<border-color>, :edges["border-top-color", "border-right-color", "border-bottom-color", "border-left-color"], :synopsis("[ <color> | transparent ]\{1,4}")},], 'summary item';
pipe( $input-path, {
CSS::Specification::Build::generate( 'grammar', $grammar-name );
}, 't/CSS/Aural/Spec/Grammar.pm');
capture({
CSS::Specification::Build::generate( 'grammar', $grammar-name, :$input-path );
}, 'lib/t/CSS/Aural/Spec/Grammar.pm');
lives-ok {require ::($grammar-name)}, "$grammar-name compilation";
pipe( $input-path, {
CSS::Specification::Build::generate( 'actions', $actions-name );
}, 't/CSS/Aural/Spec/Actions.pm');
capture({
CSS::Specification::Build::generate( 'actions', $actions-name, :$input-path );
}, 'lib/t/CSS/Aural/Spec/Actions.pm');
lives-ok {require ::($actions-name)}, "$actions-name compilation";
my $aural-interface-code = pipe( $input-path, {
CSS::Specification::Build::generate( 'interface', $interface-name );
}, 't/CSS/Aural/Spec/Interface.pm');
capture({
CSS::Specification::Build::generate( 'interface', $interface-name, :$input-path );
}, 'lib/t/CSS/Aural/Spec/Interface.pm');
lives-ok {require ::($interface-name)}, "$interface-name compilation";
dies-ok {require ::("CSS::Aural::BadGrammar")}, 'grammar composition, unimplemented interface - dies';
dies-ok {require ::("t::CSS::Aural::BadGrammar")}, 'grammar composition, unimplemented interface - dies';
my $aural-class;
lives-ok {require ::("CSS::Aural::Grammar"); $aural-class = ::("CSS::Aural::Grammar")}, 'grammar composition - lives';
isa-ok $aural-class, ::("CSS::Aural::Grammar");
lives-ok {require ::("t::CSS::Aural::Grammar"); $aural-class = ::("t::CSS::Aural::Grammar")}, 'grammar composition - lives';
isa-ok $aural-class, ::("t::CSS::Aural::Grammar");
my $actions;
lives-ok {require ::("CSS::Aural::Actions"); $actions = ::("CSS::Aural::Actions").new}, 'class composition - lives';
ok $actions.defined, '::("CSS::Aural::Actions").new';
lives-ok {require ::("t::CSS::Aural::Actions"); $actions = ::("t::CSS::Aural::Actions").new}, 'class composition - lives';
ok $actions.defined, '::("t::CSS::Aural::Actions").new';
for ('.aural-test { stress: 42; speech-rate: fast; volume: inherit; voice-family: female; }' =>
{ast => { :stylesheet[

0 comments on commit 9d9b6e9

Please sign in to comment.