Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Dec 7, 2023
1 parent 07e102d commit 6fc2a18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ describe( 'AFCH.removeEmptySectionAtEnd', function () {
expect( output ).toBe( 'Test\n\n==Test2==\n\n[[Category:Test]]\n\n [[Category:Test2]]\n' );
} );

it( 'don\'t trim if no heading was deleted', function () {
var wikicode = 'Test\n\n';
var output = AFCH.removeEmptySectionAtEnd( wikicode );
expect( output ).toBe( 'Test\n\n' );
} );

// Catastrophic backtracking occurs if this test causes the test suite to get stuck for a long time
it( 'should not cause regex catastrophic backtracking', function () {
var wikicode = '{{AFC submission}}\n==A==\n \nB';
Expand Down

0 comments on commit 6fc2a18

Please sign in to comment.