Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cho45/test-html-differences
Perl module for testing HTML structure
https://github.com/cho45/test-html-differences
html perl testing
Last synced: 6 days ago
JSON representation
Perl module for testing HTML structure
- Host: GitHub
- URL: https://github.com/cho45/test-html-differences
- Owner: cho45
- License: other
- Created: 2010-12-03T23:19:10.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2016-12-09T03:18:51.000Z (about 8 years ago)
- Last Synced: 2024-10-31T09:15:47.487Z (about 2 months ago)
- Topics: html, perl, testing
- Language: Perl
- Homepage:
- Size: 28.3 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Test::HTML::Differences - Compare two html structures and show differences if it is not same
# SYNOPSIS
use Test::Base -Base;
use Test::HTML::Differences;plan tests => 1 * blocks;
run {
my ($block) = @_;
eq_or_diff_html(
$block->input,
$block->expected,
$block->name
);
};__END__
=== test
--- input
foo foo
--- expected
# DESCRIPTION
Test::HTML::Differences is test utility that compares two strings as HTML and show differences with Test::Differences.
Supplied HTML strings are normalized to data structure and show pretty formatted as it is shown.
This module does not test all HTML node strictly,
leading/trailing white-space characters are removed by the normalize function,
but do test whole structures of the HTML.For example:
foo
is called equal to following:
foo
You must test these case by other methods, for example, old-school `like` or `is` function in Test::More as you want to test it.
## With Test::Differences::Color
Test::HTML::Differences supports Test::Differences::Color as following:
use Test::HTML::Differences -color;
# AUTHOR
cho45
# SEE ALSO
[Test::Differences](https://metacpan.org/pod/Test::Differences), [Test::Differences::Color](https://metacpan.org/pod/Test::Differences::Color)
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.