Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary tests and improve regex matching for multiline #22

Open
iuravic opened this issue Nov 22, 2019 · 0 comments
Open

Remove unnecessary tests and improve regex matching for multiline #22

iuravic opened this issue Nov 22, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@iuravic
Copy link
Contributor

iuravic commented Nov 22, 2019

Is your feature request related to a problem? Please describe.
The main point was described in detail in this conversation.

Some existing unit tests are overly paranoid, feeding the patcher with invalid source code and making sure it works even then. This is unnecessary and we should always expect valid HTML source code.

We should clean up and remove several such tests, and allow expanding several regex patterns to multiline, as well as remove a line from a patcher which strips line breaks in order to make it sturdier.

Describe the solution you'd like
These two regexes

[pullquote
author="Arthur"]"An interesting quote..."[/pullquote]

At this point, these four tests will start failing, but we should completely remove two of them, and modify the other two, not to include/expect invalid HTML code:

  • TestAudioPatcher::test_should_skip_patching_invalid_audios
  • TestAudioPatcher::test_should_correctly_patch_a_comprehensive_audio_conversion_example
  • TestVideoPatcher::test_should_skip_patching_invalid_videos
  • TestVideoPatcher::test_should_correctly_patch_a_comprehensive_video_conversion_example

Finally, we can now remove the following line from the ShortcodePullquotePatcher:

Describe alternatives you've considered
It's not necessary to consider invalid HTML code.

Additional context
/

@iuravic iuravic added the enhancement New feature or request label Nov 22, 2019
@iuravic iuravic self-assigned this Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant