From 82069f7db5415cc38c9509cc861625489add1371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 8 Oct 2022 19:26:59 +0200 Subject: [PATCH] Add test cases for T313093 Change-Id: I045be8da8fc144846312ce84b9e79d65c3d5b2b4 --- .../accidental-transclusion1-modified.html | 5 +++++ ...accidental-transclusion1-transcludedFrom.json | 3 +++ .../accidental-transclusion1.html | 5 +++++ .../accidental-transclusion2-modified.html | 3 +++ ...accidental-transclusion2-transcludedFrom.json | 3 +++ .../accidental-transclusion2.html | 3 +++ tests/cases/modified.json | 16 ++++++++++++++++ tests/cases/transcluded.json | 16 ++++++++++++++++ tests/qunit/modifier.test.js | 4 +++- 9 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tests/cases/accidental-transclusion1/accidental-transclusion1-modified.html create mode 100644 tests/cases/accidental-transclusion1/accidental-transclusion1-transcludedFrom.json create mode 100644 tests/cases/accidental-transclusion1/accidental-transclusion1.html create mode 100644 tests/cases/accidental-transclusion2/accidental-transclusion2-modified.html create mode 100644 tests/cases/accidental-transclusion2/accidental-transclusion2-transcludedFrom.json create mode 100644 tests/cases/accidental-transclusion2/accidental-transclusion2.html diff --git a/tests/cases/accidental-transclusion1/accidental-transclusion1-modified.html b/tests/cases/accidental-transclusion1/accidental-transclusion1-modified.html new file mode 100644 index 000000000..162718ac7 --- /dev/null +++ b/tests/cases/accidental-transclusion1/accidental-transclusion1-modified.html @@ -0,0 +1,5 @@ + +Talk:T265528

test

+

Hello

+ +

Hello Matma Rex (talk) 00:00, 1 October 2022 (UTC)

\ No newline at end of file diff --git a/tests/cases/accidental-transclusion1/accidental-transclusion1-transcludedFrom.json b/tests/cases/accidental-transclusion1/accidental-transclusion1-transcludedFrom.json new file mode 100644 index 000000000..3277ea5c5 --- /dev/null +++ b/tests/cases/accidental-transclusion1/accidental-transclusion1-transcludedFrom.json @@ -0,0 +1,3 @@ +{ + "c-Matma_Rex-20221001000000-test": true +} diff --git a/tests/cases/accidental-transclusion1/accidental-transclusion1.html b/tests/cases/accidental-transclusion1/accidental-transclusion1.html new file mode 100644 index 000000000..162718ac7 --- /dev/null +++ b/tests/cases/accidental-transclusion1/accidental-transclusion1.html @@ -0,0 +1,5 @@ + +Talk:T265528

test

+

Hello

+ +

Hello Matma Rex (talk) 00:00, 1 October 2022 (UTC)

\ No newline at end of file diff --git a/tests/cases/accidental-transclusion2/accidental-transclusion2-modified.html b/tests/cases/accidental-transclusion2/accidental-transclusion2-modified.html new file mode 100644 index 000000000..2eac2f26c --- /dev/null +++ b/tests/cases/accidental-transclusion2/accidental-transclusion2-modified.html @@ -0,0 +1,3 @@ + +Talk:T313093

test

+

Hello Matma Rex (talk) 00:00, 1 October 2022 (UTC)

\ No newline at end of file diff --git a/tests/cases/accidental-transclusion2/accidental-transclusion2-transcludedFrom.json b/tests/cases/accidental-transclusion2/accidental-transclusion2-transcludedFrom.json new file mode 100644 index 000000000..3277ea5c5 --- /dev/null +++ b/tests/cases/accidental-transclusion2/accidental-transclusion2-transcludedFrom.json @@ -0,0 +1,3 @@ +{ + "c-Matma_Rex-20221001000000-test": true +} diff --git a/tests/cases/accidental-transclusion2/accidental-transclusion2.html b/tests/cases/accidental-transclusion2/accidental-transclusion2.html new file mode 100644 index 000000000..2eac2f26c --- /dev/null +++ b/tests/cases/accidental-transclusion2/accidental-transclusion2.html @@ -0,0 +1,3 @@ + +Talk:T313093

test

+

Hello Matma Rex (talk) 00:00, 1 October 2022 (UTC)

\ No newline at end of file diff --git a/tests/cases/modified.json b/tests/cases/modified.json index 7d0e9964f..4a862404a 100644 --- a/tests/cases/modified.json +++ b/tests/cases/modified.json @@ -177,6 +177,22 @@ "config": "../data/eswiki-config.json", "data": "../data/eswiki-data.json" }, + { + "name": "Accidental complex transclusion (T265528)", + "title": "Talk:T265528", + "dom": "cases/accidental-transclusion1/accidental-transclusion1.html", + "expected": "cases/accidental-transclusion1/accidental-transclusion1-modified.html", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, + { + "name": "Accidental complex transclusion (T313093)", + "title": "Talk:T313093", + "dom": "cases/accidental-transclusion2/accidental-transclusion2.html", + "expected": "cases/accidental-transclusion2/accidental-transclusion2-modified.html", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, { "name": "Signatures in funny places", "title": "Talk:Signatures funny", diff --git a/tests/cases/transcluded.json b/tests/cases/transcluded.json index 67def4ad6..6772dcb19 100644 --- a/tests/cases/transcluded.json +++ b/tests/cases/transcluded.json @@ -31,6 +31,22 @@ "config": "../data/itwiki-config.json", "data": "../data/itwiki-data.json" }, + { + "name": "Accidental complex transclusion (T265528)", + "title": "Talk:T265528", + "dom": "cases/accidental-transclusion1/accidental-transclusion1.html", + "expected": "../cases/accidental-transclusion1/accidental-transclusion1-transcludedFrom.json", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, + { + "name": "Accidental complex transclusion (T313093)", + "title": "Talk:T313093", + "dom": "cases/accidental-transclusion2/accidental-transclusion2.html", + "expected": "../cases/accidental-transclusion2/accidental-transclusion2-transcludedFrom.json", + "config": "../data/enwiki-config.json", + "data": "../data/enwiki-data.json" + }, { "name": "tracked template", "title": "Commons talk:SPARQL query service", diff --git a/tests/qunit/modifier.test.js b/tests/qunit/modifier.test.js index 8f3475aa6..1ef7e216d 100644 --- a/tests/qunit/modifier.test.js +++ b/tests/qunit/modifier.test.js @@ -25,7 +25,9 @@ require( '../cases/modified.json' ).forEach( function ( caseItem ) { 'arwiki no-paragraph parsoid', 'enwiki parsoid', 'Many comments consisting of a block template and a paragraph', - 'Comment whose range almost exactly matches a template, but is not considered transcluded (T313100)' + 'Comment whose range almost exactly matches a template, but is not considered transcluded (T313100)', + 'Accidental complex transclusion (T265528)', + 'Accidental complex transclusion (T313093)' ]; if ( haveTranscludedComments.indexOf( caseItem.name ) !== -1 ) { QUnit.skip( testName );