draegtun / builder Goto Github PK
View Code? Open in Web Editor NEWBuild XML, HTML, CSS & more using Perl
Home Page: http://search.cpan.org/dist/Builder/
Build XML, HTML, CSS & more using Perl
Home Page: http://search.cpan.org/dist/Builder/
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.