Files
syskiller 2d48091205 줄바꿈을 LF로 통일
서버에서 바로 빌드하고 고칠 수 있게 저장소 줄바꿈을 LF로 맞췄습니다.
CRLF로 들어가 있던 sh 빌드 스크립트도 이제 리눅스에서 그대로 돌아갑니다.
내용은 바뀌지 않았습니다.
2026-11-24 07:13:54 +09:00

27 lines
1.8 KiB
JavaScript

// 1.6.11 test2: an old T7Emu (save written 2 bytes off) is named in red; after saving with this Studio the note is gone.
// node test/ui_t7old_test.js <ROM with an old T7Emu> <ROM with a current T7Emu> <out_dir>
const { chromium } = require('playwright');
const fs = require('fs'), path = require('path');
(async () => {
const [oldr, newr, out] = process.argv.slice(2);
fs.mkdirSync(out, { recursive: true });
let bad = 0; const ok = (c, m) => { console.log((c ? 'ok ' : 'FAIL ') + m); if (!c) bad++; };
const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1280, height: 900 }, acceptDownloads: true });
const errors = []; p.on('pageerror', (e) => errors.push(e.message));
await p.addInitScript(() => { try { localStorage.setItem('paramix-lang', 'de'); } catch (e) {} });
await p.goto('file://' + path.resolve(__dirname, '../dist/ParamixStudio.html'));
const warn = () => p.evaluate(() => [...document.querySelectorAll('#plan .rule.warn')].map((x) => x.textContent).join(' | '));
await p.setInputFiles('#fileRom', newr); await p.waitForSelector('#work.on', { timeout: 60000 }); await p.waitForTimeout(2000);
ok(!/veraltete Version/.test(await warn()), 'current T7Emu: no note');
await p.setInputFiles('#fileRom', oldr); await p.waitForTimeout(3000);
const w = await warn(); ok(/TAMA-GO: veraltete Version/.test(w), 'old T7Emu named: ' + w);
const dlp = p.waitForEvent('download', { timeout: 300000 }); await p.click('#btnSave');
const dl = await dlp; const r1 = out + '/' + dl.suggestedFilename(); await dl.saveAs(r1);
await p.setInputFiles('#fileRom', r1); await p.waitForTimeout(3000);
ok(!/veraltete Version/.test(await warn()), 'written anew: note gone');
ok(!errors.length, 'no page errors ' + errors.join('; '));
fs.unlinkSync(r1);
await b.close();
console.log(bad ? 'FAIL ' + bad : 'all good');
})();