From 22a2a3c526e10f131758e5e442df49541366a47c Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 26 Nov 2022 16:33:00 -0500 Subject: [PATCH] test: make trace-gc-flag tests less strict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45579 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- test/v8-updates/test-trace-gc-flag.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/v8-updates/test-trace-gc-flag.js b/test/v8-updates/test-trace-gc-flag.js index 0fe9beb52a3503..b81366f0710b2e 100644 --- a/test/v8-updates/test-trace-gc-flag.js +++ b/test/v8-updates/test-trace-gc-flag.js @@ -19,15 +19,11 @@ const fixtures = require('../common/fixtures'); const lines = splitByLine(output); const scavengeRegex = /\bScavenge\b/; - const expectedOutput = [ - scavengeRegex, - scavengeRegex, - scavengeRegex, - scavengeRegex, - /\bMark-Compact\b/, - ]; + const eofRegex = /\bMark-Compact\b/; + lines.forEach((line, index) => { - assert.match(line, expectedOutput[index]); + const expected = index !== lines.length - 1 ? scavengeRegex : eofRegex; + assert.match(line, expected); }); }