CSS-Prepare

 view release on metacpan or  search on metacpan

t/01.values.t  view on Meta::CPAN

            "list-style-type: '$value'" );
    }
    ok( ! is_list_style_type_value( 'upper-greek' ),
        "not list-style-type: 'upper-greek'" );
    
    
    foreach my $value qw( url(blah.gif)  none  inherit ) {
        ok( is_list_style_image_value( $value ),
            "list-style-image: '$value'" );
    }
    ok( ! is_list_style_image_value( 'disc' ),
        "list-style-image: 'disc'" );
    
    
    foreach my $value qw( inside  outside  inherit ) {
        ok( is_list_style_position_value( $value ),
            "list-style-position: '$value'" );
    }
    ok( ! is_list_style_position_value( 'all-about' ),
        "not list-style-position: 'all-about'" );
}

# test fonts
{
    my @font_families = (
            'Arial', 'Helvetica', q('Monaco'), q("Courier"),
            '"Gill Sans"', '"Times New Roman"',
            'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace',
            q("Arial", "Helvetica", sans-serif),
            q(Arial, Helvetica, sans-serif),
            q(Arial,Helvetica,sans-serif),
            'inherit',
        );
    foreach my $value ( @font_families ) {
        ok( is_font_family_value( $value ),
            "font-family: '$value'" );
    }
    ok( ! is_font_family_value( 'Gill Sans' ),
        "font-family: 'Gill Sans'" );
    ok( ! is_font_family_value( '"Arial" sans-serif' ),
        q(font-family: '"Arial" sans-serif') );
    
    
    foreach my $value qw( normal  italic  oblique  inherit ) {
        ok( is_font_style_value( $value ),
            "font-style: '$value'" );
    }
    ok( ! is_font_style_value( 'slanted' ),
        "not font-style: 'slanted'" );
    
    
    foreach my $value qw( normal  small-caps  inherit ) {
        ok( is_font_variant_value( $value ),
            "font-variant: '$value'" );
    }
    ok( ! is_font_variant_value( 'drop-cap' ),
        "not font-variant: 'drop-cap'" );
    
    
    my @font_weight_values = qw(
            normal  bold  bolder  lighter  inherit
            100     200   300     400      500
            600     700   800     900
        );
    foreach my $value ( @font_weight_values ) {
        ok( is_font_weight_value( $value ),
            "font-weight: '$value'" );
    }
    ok( ! is_font_weight_value( 'light' ),
        "not font-weight: 'light'" );
    
    
    my @font_sizes = qw(
            xx-small  x-small  small  medium  large  x-large  xx-large 
            larger    smaller  inherit
        );
    foreach my $value ( @font_sizes, '5px', '123.8%' ) {
        ok( is_font_size_value( $value ),
            "font-size: '$value'" );
    }
    ok( ! is_font_size_value( '23' ),
        "not font-size: '23'" );
    
    
    foreach my $value ( '12px/20px', '1em/1.2' ) {
        ok( is_font_size_line_height_value( $value ),
            "font-size/line-height: '$value'" );
    }
    ok( ! is_font_size_line_height_value( '5px' ),
        "not font-size/line-height: '5px'" );
}

# test text
{
    foreach my $value qw( 20px  80%  inherit ) {
        ok( is_text_indent_value( $value ),
            "text-indent: '$value'" );
    }
    ok( ! is_text_indent_value( '8' ),
        "not text-indent: '8'" );
    
    
    foreach my $value qw( left  right  center  justify  inherit ) {
        ok( is_text_align_value( $value ),
            "text-align: '$value'" );
    }
    ok( ! is_text_align_value( 'full' ),
        "not text-align: 'full'" );
    
    
    my @text_decorations
        = qw( none  underline  overline  line-through  blink  inherit );
    foreach my $value ( @text_decorations ) {
        ok( is_text_decoration_value( $value ),
            "text-decoration: '$value'" );
    }
    ok( ! is_text_decoration_value( 'strike' ),
        "not text-decoration: 'strike'" );
    
    
    foreach my $value qw( normal  5px  inherit ) {



( run in 2.608 seconds using v1.01-cache-2.11-cpan-437f7b0c052 )