Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,69 @@
'use strict';
function fnA() {
let cnt = 0;
try {
cnt++;
throw new Error('boom');
cnt++;
} catch (err) {
cnt++;
} finally {
if (false) {
}
return cnt;
}
cnt++;
}
function fnB(arr) {
for (let i = 0; i < arr.length; ++i) {
if (i === 2) {
continue;
} else {
fnE(1);
}
}
}
function fnC(arg1, arg2) {
if (arg1 === 1) {
if (arg2 === 3) {
return -1;
}
if (arg2 === 4) {
return 3;
}
if (arg2 === 5) {
return 9;
}
}
}
function fnD(arg) {
let cnt = 0;
if (arg % 2 === 0) {
cnt++;
} else if (arg === 1) {
cnt++;
} else if (arg === 3) {
cnt++;
} else {
fnC(1, 5);
}
return cnt;
}
function fnE(arg) {
const a = arg ?? 5;
return a;
}
module.exports = { fnA, fnB, fnC, fnD, fnE };

View File

@ -0,0 +1,12 @@
'use strict';
const { test } = require('node:test');
const common = require('./common');
function notCalled() {
}
test('first 1', () => {
common.fnA();
common.fnD(100);
common.fnB([1, 2, 3]);
});

View File

@ -0,0 +1,8 @@
'use strict';
const { test } = require('node:test');
const common = require('./common');
test('second 1', () => {
common.fnB([1, 2, 3]);
common.fnD(3);
});

View File

@ -0,0 +1,25 @@
'use strict';
const assert = require('node:assert');
const { unlinkSync, writeFileSync } = require('node:fs')
const { join } = require('node:path');
const { test } = require('node:test');
const common = require('./common');
test('third 1', () => {
common.fnC(1, 4);
common.fnD(99);
});
assert(process.env.NODE_TEST_TMPDIR);
const tmpFilePath = join(process.env.NODE_TEST_TMPDIR, 'temp-module.js');
writeFileSync(tmpFilePath, `
module.exports = {
fn() {
return 42;
}
};
`);
const tempModule = require(tmpFilePath);
assert.strictEqual(tempModule.fn(), 42);
// Deleted files should not be part of the coverage report.
unlinkSync(tmpFilePath);