Skip to content

Commit

Permalink
Add more test cases with non-empty changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Aug 13, 2023
1 parent b46df4a commit 43db05f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public function data_html_with_inner_markup_changes() {
'Unclosed nested element' => array( '<div><p target>One thought<p>And another', '', '<div><p target><p>And another' ),
'Partially-closed element' => array( '<div target>This is <em>all</em> inside the DIV</div', '', '<div target>' ),
'Implicitly-closed element' => array( '<div><p target>Inside the P</div>Outside the P</p>', '', '<div><p target></div>Outside the P</p>' ),

'Text markup' => array( '<span target></span>', 'Today is the best day to start.', '<span target>Today is the best day to start.</span>' ),
'Text with ampersand (raw)' => array( '<span target></span>', 'Today & yesterday are the best days to start.', '<span target>Today & yesterday are the best days to start.</span>' ),
'Text with tag (raw)' => array( '<span target></span>', 'Yesterday <em>was</em> the best day to start.', '<span target>Yesterday <em>was</em> the best day to start.</span>' ),
'Text with unclosed tag (raw)' => array( '<span target></span>', 'Yesterday <em>was the best day to start.', '<span target>Yesterday <em>was the best day to start.</span>' ),
'Text with ending tag (raw)' => array( '<span target></span>', 'Here is no </div>', '<span target>Here is no </div></span>' ),
'Text with scope-creating tag (raw)' => array( '<span target></span>', '<p>Start<p>Finish<p>Repeat', '<span target><p>Start<p>Finish<p>Repeat</span>' ),
'Text with scope-ending tag (raw)' => array( '<span target></span>', 'Sneaky closing </span> No more span.', '<span target>Sneaky closing </span> No more span.</span>' ),
);

$inner_html = <<<HTML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public function data_html_with_outer_markup_changes() {
'Unclosed nested element' => array( '<div><p target>One thought<p>And another', '', '<div><p>And another' ),
'Partially-closed element' => array( '<div target>This is <em>all</em> inside the DIV</div', '', '' ),
'Implicitly-closed element' => array( '<div><p target>Inside the P</div>Outside the P</p>', '', '<div></div>Outside the P</p>' ),

'Text markup' => array( '<span target></span>', 'Today is the best day to start.', 'Today is the best day to start.' ),
'Text with ampersand (raw)' => array( '<span target></span>', 'Today & yesterday are the best days to start.', 'Today & yesterday are the best days to start.' ),
'Text with tag (raw)' => array( '<span target></span>', 'Yesterday <em>was</em> the best day to start.', 'Yesterday <em>was</em> the best day to start.' ),
'Text with unclosed tag (raw)' => array( '<span target></span>', 'Yesterday <em>was the best day to start.', 'Yesterday <em>was the best day to start.' ),
'Text with ending tag (raw)' => array( '<span target></span>', 'Here is no </div>', 'Here is no </div>' ),
'Text with scope-creating tag (raw)' => array( '<span target></span>', '<p>Start<p>Finish<p>Repeat', '<p>Start<p>Finish<p>Repeat' ),
'Text with scope-ending tag (raw)' => array( '<span target></span>', 'Sneaky closing </span> No more span.', 'Sneaky closing </span> No more span.' ),
);

/*
Expand Down

0 comments on commit 43db05f

Please sign in to comment.