From ce9241931f1cab26302c194528922ca42cb05dca Mon Sep 17 00:00:00 2001 From: ctcpip Date: Tue, 31 Oct 2023 16:17:03 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20add=20additional=20example=20to=20t?= =?UTF-8?q?est=20assertions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/bad-linebreaks-test.mjs | 16 ++++++++-------- .../test-samples/bad-linebreaks-sample-after.md | 2 ++ .../test-samples/bad-linebreaks-sample-before.md | 10 ++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/bad-linebreaks-test.mjs b/scripts/bad-linebreaks-test.mjs index 516923a1..74c19aac 100644 --- a/scripts/bad-linebreaks-test.mjs +++ b/scripts/bad-linebreaks-test.mjs @@ -7,18 +7,18 @@ const afterMD = './scripts/test-samples/bad-linebreaks-sample-after.md'; const beforeMD = './scripts/test-samples/bad-linebreaks-sample-before.md'; // verify hash values to detect file tampering -const knownAfterHash = '5f29c1fb4abd747c2dd801e12c600ee3'; -const knownBeforeHash = '406e900af5cd9af66abbe5b3ab6bcf3e'; -const afterHash = await getHashSlingingSlasher(afterMD); +const knownBeforeHash = '135c042cd49cb6b21ebadc83b0f247ba'; +const knownAfterHash = 'cf287b7594663879a10e866b47c76fef'; const beforeHash = await getHashSlingingSlasher(beforeMD); -assert.strictEqual(afterHash, knownAfterHash); +const afterHash = await getHashSlingingSlasher(afterMD); assert.strictEqual(beforeHash, knownBeforeHash); +assert.strictEqual(afterHash, knownAfterHash); let fixed, totalMatches; ({ fixed, totalMatches } = findBadStuff(beforeMD, true)); -assert.strictEqual(totalMatches.badLinebreaks, 12); -assert.strictEqual(totalMatches.extraWhitespace, 114); +assert.strictEqual(totalMatches.badLinebreaks, 20); +assert.strictEqual(totalMatches.extraWhitespace, 124); assert.strictEqual(fixed, fs.readFileSync(afterMD, 'utf8').toString()); ({ fixed, totalMatches } = findBadStuff(afterMD, true)); @@ -27,8 +27,8 @@ assert.strictEqual(totalMatches.extraWhitespace, 0); assert.strictEqual(fixed, fs.readFileSync(afterMD, 'utf8').toString()); ({ fixed, totalMatches } = findBadStuff(beforeMD)); -assert.strictEqual(totalMatches.badLinebreaks, 12); -assert.strictEqual(totalMatches.extraWhitespace, 114); +assert.strictEqual(totalMatches.badLinebreaks, 20); +assert.strictEqual(totalMatches.extraWhitespace, 124); function getHashSlingingSlasher(file) { // 💀 return new Promise((res, rej) => { diff --git a/scripts/test-samples/bad-linebreaks-sample-after.md b/scripts/test-samples/bad-linebreaks-sample-after.md index daf2183d..a6c6a1e1 100644 --- a/scripts/test-samples/bad-linebreaks-sample-after.md +++ b/scripts/test-samples/bad-linebreaks-sample-after.md @@ -53,6 +53,8 @@ let biscuits = "delicious"; * one more + time +All right, what about the current agenda? Are there any objections to the current agenda? And I will say because I’m working on a laptop, I cannot see the element room right now. If any of the other chairs do see anything, please just interrupt. I’m going to take silence as approval. I will say with today’s current agenda, or this week’s current agenda, it is packed. It is oversubscribed. You’ll see that we have many really good items in the overflow slot at the moment. We’re going to work you know, we’re going to do our best to claw some back. Maybe some people will consider deprioritizing items. I know I’ve already heard some some candidates there that we may do. But the main thing is we need to really work hard to keep -- to do food time keeping and stick to our time boxes. + ## story time! True! nervous, very, very dreadfully nervous I had been and am; but why will you say that I am mad? The disease had sharpened my senses, not destroyed, not dulled them. Above all was the sense of hearing acute. I heard all things in the heaven and in the earth. I heard many things in hell. How then am I mad? Hearken! and observe how healthily, how calmly I can tell you the whole story. diff --git a/scripts/test-samples/bad-linebreaks-sample-before.md b/scripts/test-samples/bad-linebreaks-sample-before.md index fc2cda9f..7f3bdc26 100644 --- a/scripts/test-samples/bad-linebreaks-sample-before.md +++ b/scripts/test-samples/bad-linebreaks-sample-before.md @@ -59,6 +59,16 @@ let biscuits = "delicious"; * one more + time +All right, what about the current agenda? Are there any objections to the current agenda? And +I will say because I’m working on a laptop, I cannot see the element room right now. If any of +the other chairs do see anything, please just interrupt. I’m going to take silence as +approval. I will say with today’s current agenda, or this week’s current agenda, it is packed. +It is oversubscribed. You’ll see that we have many really good items in the overflow slot at +the moment. We’re going to work you know, we’re going to do our best to claw some back. +Maybe some people will consider deprioritizing items. I know I’ve already heard some some +candidates there that we may do. But the main thing is we need to really work hard to keep -- +to do food time keeping and stick to our time boxes. + ## story time! True! nervous, very, very dreadfully nervous I had been and am; but why will you say that I am mad? The disease had sharpened my senses, not destroyed,