Skip to content

Commit

Permalink
Over report normative statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Sep 12, 2024
1 parent 4bf0dfd commit c0d4cee
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c0d4cee

Please sign in to comment.