CSS-Prepare

 view release on metacpan or  search on metacpan

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

        );
    foreach my $value ( @valid_display_values ) {
        ok( is_display_value( $value ),
            "display: '$value'" );
    }
    ok( ! is_display_value( 'run-on' ),
        "not display: 'run-on'" );
    
    
    foreach my $value qw( static  relative  absolute  fixed  inherit ) {
        ok( is_position_value( $value ),
            "position: '$value'" );
    }
    ok( ! is_position_value( 'float' ),
        "not position: 'float'" );
    
    
    # top, right, bottom, left properties
    # other lengths and percentages are tested above
    foreach my $value qw( 5px  20%  auto  inherit ) {
        ok( is_offset_value( $value ),
            "offset: '$value'" );
    }
    ok( ! is_offset_value( 'bottom' ),
        "not offset: 'bottom'" );
    
    
    foreach my $value qw( left  right  none  inherit ) {
        ok( is_float_value( $value ),
            "float: '$value'" );
    }
    ok( ! is_float_value( 'side' ),
        "not float: 'side'" );
    
    
    foreach my $value qw( left  right  both  none  inherit ) {
        ok( is_clear_value( $value ),
            "clear: '$value'" );
    }
    ok( ! is_clear_value( 'all' ),
        "not clear: 'all'" );
    
    
    foreach my $value qw( auto  5  inherit ) {
        ok( is_z_index_value( $value ),
            "z-index: '$value'" );
    }
    ok( ! is_z_index_value( '10px' ),
        "not z-index: '10px'" );
    
    
    foreach my $value qw( ltr  rtl  inherit ) {
        ok( is_direction_value( $value ),
            "direction: '$value'" );
    }
    ok( ! is_direction_value( 'backwards' ),
        "not direction: 'backwards'" );
    
    
    foreach my $value qw( embed  bidi-override  inherit  normal ) {
        ok( is_unicode_bidi_value( $value ),
            "unicode-bidi: '$value'" );
    }
    ok( ! is_unicode_bidi_value( 'bidi-curious' ),
        "not unicode-bidi: 'bidi-curious'" );
    
    
    # other lengths and percentages are tested above
    my @vertical_align_values = qw(
          baseline  sub     super   top
          text-top  middle  bottom  text-bottom
          5px       20%     inherit
        );
    foreach my $value ( @vertical_align_values ) {
        ok( is_vertical_align_value( $value ),
            "vertical-align: '$value'" );
    }
    ok( ! is_vertical_align_value( 'up' ),
        "not vertical-align: 'up'" );
    ok( ! is_vertical_align_value( '5' ),
        "not vertical-align: '5'" );
    
    
    # other lengths and percentages are tested above
    foreach my $value qw( 5px 20% inherit ) {
        ok( is_height_value( $value ),
            "height: '$value'" );
        ok( is_max_height_value( $value ),
            "max-height: '$value'" );
        ok( is_min_height_value( $value ),
            "min-height: '$value'" );
        ok( is_width_value( $value ),
            "width: '$value'" );
        ok( is_max_width_value( $value ),
            "max-width: '$value'" );
        ok( is_min_width_value( $value ),
            "min-width: '$value'" );
    }
    ok( is_height_value( 'auto' ),
        "height: 'auto'" );
    ok( ! is_max_height_value( 'auto' ),
        "not max-height: 'auto'" );
    ok( ! is_min_height_value( 'auto' ),
        "not min-height: 'auto'" );
    ok( is_width_value( 'auto' ),
        "width: 'auto'" );
    ok( ! is_max_width_value( 'auto' ),
        "not max-width: 'auto'" );
    ok( ! is_min_width_value( 'auto' ),
        "not min-width: 'auto'" );
    ok( ! is_height_value( 'none' ),
        "height: 'none'" );
    ok( is_max_height_value( 'none' ),
        "max-height: 'none'" );
    ok( ! is_min_height_value( 'none' ),
        "not min-height: 'none'" );
    ok( ! is_width_value( 'none' ),
        "not width: 'none'" );
    ok( is_max_width_value( 'none' ),
        "max-width: 'none'" );
    ok( ! is_min_width_value( 'none' ),
        "not min-width: 'none'" );
    
    
    # other lengths and percentages are tested above



( run in 0.674 second using v1.01-cache-2.11-cpan-39bf76dae61 )