From bfa0505d423a5cb55955de4aa0556ef7a987c7df Mon Sep 17 00:00:00 2001 From: Courey Elliott Date: Thu, 18 Jul 2024 11:30:27 -0400 Subject: [PATCH] update test because intentionally odd spacing got removed. also removes additional test. --- src/replacements/gcn-circular/test.html | 2 +- src/replacements/gcn-circular/test.json | 2 +- test.ts | 71 ------------------------- 3 files changed, 2 insertions(+), 73 deletions(-) diff --git a/src/replacements/gcn-circular/test.html b/src/replacements/gcn-circular/test.html index 95465c4..4829251 100644 --- a/src/replacements/gcn-circular/test.html +++ b/src/replacements/gcn-circular/test.html @@ -47,4 +47,4 @@

Hello, world

GCN circs #123 #456 (GCN circs 123 456) GCN #123 -gcn 123

\ No newline at end of file +gcn 123

\ No newline at end of file diff --git a/src/replacements/gcn-circular/test.json b/src/replacements/gcn-circular/test.json index 027e060..9c2fadd 100644 --- a/src/replacements/gcn-circular/test.json +++ b/src/replacements/gcn-circular/test.json @@ -1111,7 +1111,7 @@ }, { "type": "text", - "value": "gcn " + "value": "gcn " }, { "type": "text", diff --git a/test.ts b/test.ts index 0074cb5..405353b 100644 --- a/test.ts +++ b/test.ts @@ -71,75 +71,4 @@ describe.each([ expect(splitLines(result)).toStrictEqual(splitLines(expected)) } ) - - test.each([ - 'GCN 123', - 'GCN #123', - '(GCN 123)', - '(GCN #123)', - 'GCN circ. 123', - 'GCN circ. #123', - '(GCN circ. #123)', - 'GCN circ 123', - '(GCN circ 123)', - 'GCN Circ. 123', - 'GCN Circ. #123', - '(GCN Circ. #123)', - 'GCN Circ 123', - '(GCN Circ 123)', - 'GCN Circular 123', - 'GCN Circular #123', - '(GCN Circular 123)', - '(GCN Circular #123)', - 'GCN Circs 123, 456', - 'GCN Circs. 123, 456', - 'GCN Circs #123, #456', - '(GCN Circs #123, #456)', - '(GCN Circs 123, 456)', - 'GCN Circ 123, 456', - 'GCN Circ. 123, 456', - 'GCN Circ #123, #456', - '(GCN Circ 123, 456)', - 'GCN circs 123, 456', - 'GCN circs. 123, 456', - 'GCN circs #123, #456', - '(GCN circs 123, 456)', - 'GCN circs 123 and 456', - 'GCN circs. 123 and 456', - 'GCN circs #123 and #456', - '(GCN circs 123 and 456)', - 'GCN circs 123 456', - 'GCN circs. 123 456', - 'GCN circs #123 #456', - '(GCN circs 123 456)', - 'GCN #123', - 'gcn 123', - ])('GCN linking', async (testPattern) => { - const result = ( - await processor().process( - `some preceding text ${testPattern} some following text.` - ) - ).value.toString() - const circularIdString = testPattern.match(/\d+/g)?.join(', ') || '' - const circularIdArray = circularIdString.split(',').map((x) => { - return x.trim() - }) - for (const circularId of circularIdArray) { - const htmlResult = `${circularId}` - const jsonResult = { - type: 'text', - value: circularId, - data: { - class: 'gcn-circular', - value: parseInt(circularId), - }, - } - const expected = ext === 'html' ? htmlResult : JSON.stringify(jsonResult) - const formattedResult = - ext === 'html' - ? result - : JSON.stringify(JSON.parse(result).children[0].children) - expect(formattedResult).toContain(expected) - } - }) })