增加不可变源码检出、两阶段 finalize/activate、Runtime 同源对象读取与 iframe 安全边界,并用 fail-closed CI 门固定契约。Git 仅提交平台实现、契约、迁移和 SoT,不包含具体游戏源码、素材、bundle 或验收证据。
24 lines
843 B
JavaScript
24 lines
843 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
import { tmpdir } from 'node:os';
|
|
import { join } from 'node:path';
|
|
import test from 'node:test';
|
|
|
|
import { runPythonStage } from './run.mjs';
|
|
|
|
test('strict 模式下固定 Python 判例缺少任意一个都判为 MISSING', () => {
|
|
const root = mkdtempSync(join(tmpdir(), 'gate-fixtures-missing-'));
|
|
try {
|
|
writeFileSync(join(root, 'present.py'), 'def test_present():\n assert True\n');
|
|
const result = runPythonStage(
|
|
{ name: 'python-gates', files: ['present.py', 'missing.py'] },
|
|
{ repoRoot: root, requireAll: true, hasPytest: () => true },
|
|
);
|
|
|
|
assert.equal(result.status, 'MISSING');
|
|
assert.match(result.note, /missing\.py/);
|
|
} finally {
|
|
rmSync(root, { recursive: true, force: true });
|
|
}
|
|
});
|