Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2308b71

Browse filesBrowse files
bnoordhuisdanielleadams
authored andcommitted
test: don't clobber RegExp.$_ on startup
Some tests expect it to be empty so clear it again after running a regular expression against /proc/cpuinfo. It didn't cause test failures on any of the CI machines, to the best of my knowledge, because most of the time /proc/cpuinfo doesn't contain the string it was looking for. Fixes: #44840 PR-URL: #44864 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent fe91beb commit 2308b71
Copy full SHA for 2308b71

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ const isPi = (() => {
126126
// the contents of `/sys/firmware/devicetree/base/model` but that doesn't
127127
// work inside a container. Match the chipset model number instead.
128128
const cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' });
129-
return /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835';
129+
const ok = /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835';
130+
/^/.test(''); // Clear RegExp.$_, some tests expect it to be empty.
131+
return ok;
130132
} catch {
131133
return false;
132134
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.