Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more XML detection tests
  • Loading branch information
kraih committed Jan 5, 2014
1 parent 010d1c7 commit d739496
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,4 +1,6 @@

4.67 2014-01-05

4.66 2014-01-04
- Added success attribute to Test::Mojo.
- Improved Mojo::DOM::CSS and Mojo::DOM::HTML performance.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -43,7 +43,7 @@ has types => sub { Mojolicious::Types->new };
has validator => sub { Mojolicious::Validator->new };

our $CODENAME = 'Top Hat';
our $VERSION = '4.66';
our $VERSION = '4.67';

sub AUTOLOAD {
my $self = shift;
Expand Down
8 changes: 4 additions & 4 deletions t/mojo/base.t
Expand Up @@ -43,10 +43,10 @@ my $monkey = Mojo::BaseTestTestTest->new;
$monkey->attr('mojo');
$monkey->mojo(23);
is $monkey->mojo, 23, 'monkey has mojo';
ok !Mojo::BaseTestTest->can('mojo'), 'base class does not have mojo';
ok(Mojo::BaseTestTest->can('heads'), 'base class has heads');
ok !Mojo::BaseTest->can('mojo'), 'base class does not have mojo';
ok(Mojo::BaseTest->can('heads'), 'base class has heads');
ok !Mojo::BaseTestTest->can('mojo'), 'base class does not have mojo';
ok !!Mojo::BaseTestTest->can('heads'), 'base class has heads';
ok !Mojo::BaseTest->can('mojo'), 'base class does not have mojo';
ok !!Mojo::BaseTest->can('heads'), 'base class has heads';

# Default value defined but false
my $m = $monkeys[1];
Expand Down
7 changes: 4 additions & 3 deletions t/mojo/dom.t
Expand Up @@ -1752,13 +1752,14 @@ ok $dom->xml, 'XML mode active';
is $dom, '<XMLTest2 />', 'right result';

# Ensure HTML semantics
$dom = Mojo::DOM->new->xml(0)
->parse('<?xml version="1.0" encoding="UTF-8"?><br><div>Test</div>');
is $dom->at('div:root')->text, 'Test', 'right text';
ok !Mojo::DOM->new->xml(undef)->parse('<?xml version="1.0"?>')->xml,
'XML mode not detected';
$dom
= Mojo::DOM->new->xml(0)->parse('<?xml version="1.0"?><br><div>Test</div>');
is $dom->at('div:root')->text, 'Test', 'right text';

# Ensure XML semantics
ok !!Mojo::DOM->new->xml(1)->parse('<foo />')->xml, 'XML mode active';
$dom = Mojo::DOM->new->parse(<<'EOF');
<?xml version='1.0' encoding='UTF-8'?>
<table>
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/ioloop.t
Expand Up @@ -136,7 +136,7 @@ $id = Mojo::IOLoop->stream($stream);
$stream->on(close => sub { Mojo::IOLoop->stop });
$stream->on(read => sub { $buffer .= pop });
$stream->write('hello');
ok(Mojo::IOLoop->stream($id), 'stream exists');
ok !!Mojo::IOLoop->stream($id), 'stream exists';
is $stream->timeout, 16, 'right timeout';
Mojo::IOLoop->start;
Mojo::IOLoop->timer(0.25 => sub { Mojo::IOLoop->stop });
Expand Down

0 comments on commit d739496

Please sign in to comment.