GithubHelp home page GithubHelp logo

builder's People

Contributors

cpanservice avatar draegtun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

builder's Issues

Can't show false values

I tried to show "false values" (0, blank) in span tag, but it failed.

t/builder_xml_falsevalues.t

use strict;
use Test::More;
use Builder;

subtest 'False Values' => sub {
    my @testCases = (
        { input => undef, expected => '<span />',       name => 'undef' },
        { input => 0,     expected => '<span>0</span>', name => '0' },
        { input => '',    expected => '<span></span>',  name => 'blank' },
    );
    my $builder = Builder->new();
    my $xm      = $builder->block('Builder::XML');
    foreach my $testcase (@testCases) {
        $xm->span( $testcase->{input} );
        is( $builder->render, $testcase->{expected}, $testcase->{name} );
    }
};

done_testing;

result

# Subtest: False Values
Use of uninitialized value $args[0] in join or string at /usr/local/share/perl5/Builder/XML.pm line 50.
    ok 1 - undef
    not ok 2 - 0
    #   Failed test '0'
    #   at /home/Shared/builder/t/builder_xml_falsevalues.t line 15.
    #          got: '<span />'
    #     expected: '<span>0</span>'
    not ok 3 - blank
    #   Failed test 'blank'
    #   at /home/Shared/builder/t/builder_xml_falsevalues.t line 15.
    #          got: '<span />'
    #     expected: '<span></span>'
    1..3
    # Looks like you failed 2 tests of 3.
not ok 1 - False Values
#   Failed test 'False Values'
#   at ./t/builder_xml_falsevalues.t line 17.
1..1
# Looks like you failed 1 test of 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.