Skip to content

Instantly share code, notes, and snippets.

@aereal
Created August 27, 2014 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aereal/c76c260a7373813acd4a to your computer and use it in GitHub Desktop.
Save aereal/c76c260a7373813acd4a to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test::More;
use HTML::TreeBuilder::Select;
subtest 'class attribute with LF' => sub {
my $doc = <<EOS;
<div class="
my-class
">
<p>content</p>
</div>
EOS
my $tree = HTML::TreeBuilder::Select->new;
$tree->parse_content($doc);
ok $tree->select('.my-class');
};
subtest 'class attribute with no LF' => sub {
my $doc = <<EOS;
<div class="my-class">
<p>content</p>
</div>
EOS
my $tree = HTML::TreeBuilder::Select->new;
$tree->parse_content($doc);
ok $tree->select('.my-class');
};
done_testing;
@aereal
Copy link
Author

aereal commented Aug 27, 2014

[18:16:25] /Users/aereal/sketches/class_with_lf.t .. 
    not ok 1

    #   Failed test at /Users/aereal/sketches/class_with_lf.t line 17.
    1..1
    # Looks like you failed 1 test of 1.
not ok 1 - class attribute with LF

#   Failed test 'class attribute with LF'
#   at /Users/aereal/sketches/class_with_lf.t line 18.
    ok 1
    1..1
ok 2 - class attribute with no LF
1..2
# Looks like you failed 1 test of 2.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 
[18:16:25]

Test Summary Report
-------------------
/Users/aereal/sketches/class_with_lf.t (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=2,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.05 cusr  0.01 csys =  0.09 CPU)
Result: FAIL

@aereal
Copy link
Author

aereal commented Aug 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment