-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: tick processor version check regression test
Verify that v8-version log lines are parsed and matched correctly. Fixes: #16736 PR-URL: #16769 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
e0c7b3d
commit 2294ba4
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Flags: --expose-internals | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('assert'); | ||
const { versionCheck } = require('internal/v8_prof_polyfill'); | ||
|
||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,0', '1.2.3'), undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,0', '1.2.3.3'), undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,0', '1.2.3.4'), undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,0', '1.2.3.5'), undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,-node.1,0', '1.2.3'), | ||
undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,-node.1,0', '1.2.3.4'), | ||
undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,-node.1,0', '1.2.3-node.1'), | ||
undefined); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,-node.1,0', '1.2.3-node.2'), | ||
undefined); | ||
assert.strictEqual( | ||
versionCheck('v8-version,1,2,3,4,-node.1,0', '1.2.3.4-node.2'), | ||
undefined); | ||
|
||
{ | ||
const expected = 'Unable to read v8-version from log file.'; | ||
assert.strictEqual(versionCheck('faux', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,1', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,1,2', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,1,2,3,4,5,6,7', '1.2.3'), | ||
expected); | ||
} | ||
|
||
{ | ||
const expected = 'Testing v8 version different from logging version'; | ||
assert.strictEqual(versionCheck('v8-version,4,3,2,1,0', '1.2.3'), expected); | ||
assert.strictEqual(versionCheck('v8-version,4,3,2,1,0', '1.2.3.4'), expected); | ||
assert.strictEqual(versionCheck('v8-version,4,3,2,1,0', '4.3.1.1'), expected); | ||
assert.strictEqual(versionCheck('v8-version,4,3,2,1,0', '4.3.3.1'), expected); | ||
} |