From c0d4ceee1e23c44cf1e8668f753dcc324b6d35d1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 12 Sep 2024 09:40:28 -0400 Subject: [PATCH] Over report normative statements. --- bin/handlers.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/handlers.js b/bin/handlers.js index e0cbfde..dca95f3 100644 --- a/bin/handlers.js +++ b/bin/handlers.js @@ -32,17 +32,18 @@ export async function checkSpecText({specUrl, suiteLog}) { } const testTitles = new Set(tests.map(test => test?.title)); const normStatements = statements.map(s => s.text); + const sentences = new Set(statements.flatMap( + s => s.text.split(/\./)).filter(s => s.includes('MUST'))); console.log(`Test Title Count ${testTitles.size}`); console.log(`Normative Statement Count ${normStatements.length}`); + console.log(`Sentence Count ${sentences.size}`); } // the condition for the spec function textNodeWithMust(node) { - if(node instanceof TextNode) { - const {text} = node; - if(text.includes('MUST')) { - return true; - } + const {text = ''} = node; + if(text.includes('MUST')) { + return true; } return false; }