Textsystem: Bis-Strich mit Leerzeichen (Zahl – Zahl) per Agent-Sweep
562 Ersetzungen in 50 Dateien: Halbgeviertstrich zwischen zwei Ziffern (= "bis"-Bereich) bekommt Leerzeichen davor/danach (3–4 -> 3 – 4). Regex /([0-9])\s*–\s*(?=[0-9])/ auf Rohtext (format-erhaltend, CRLF/Einrueckung unveraendert), Bindestriche in Woertern und Minuszeichen unangetastet, alle JSON weiter gueltig. Energiemanager-Zeitbloecke sind Display-Labels (kein Logik-Key) -> safe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
const { chromium } = require('@playwright/test');
|
||||
(async () => {
|
||||
const b = await chromium.launch(); const p = await b.newPage();
|
||||
await p.addInitScript(() => {
|
||||
window.__GGS__ = { simId: 'test', baseUrl: '' };
|
||||
window.fetch = () => Promise.resolve({ ok:true, json:()=>Promise.resolve({}) }); // Heartbeat stummschalten
|
||||
});
|
||||
await p.goto('about:blank');
|
||||
await p.addScriptTag({ path: 'C:/xampp/htdocs/geograsim/App/assets/js/live-client.js' });
|
||||
const read = () => p.evaluate(() => window.__GGS_LIVE__ ? window.__GGS_LIVE__.activeMs : null);
|
||||
const set = (v) => p.evaluate((v) => window.__GGS_LIVE__.setPaused(v), v);
|
||||
await p.waitForTimeout(300);
|
||||
const a1 = await read();
|
||||
await p.waitForTimeout(2500); const a2 = await read(); // sollte gestiegen sein
|
||||
await set(true);
|
||||
await p.waitForTimeout(2500); const a3 = await read(); // sollte eingefroren sein
|
||||
await set(false);
|
||||
await p.waitForTimeout(2500); const a4 = await read(); // sollte wieder steigen
|
||||
const grewNormal = (a2 - a1) > 1500;
|
||||
const frozen = (a3 - a2) < 300;
|
||||
const resumed = (a4 - a3) > 1500;
|
||||
console.log(JSON.stringify({ a1,a2,a3,a4, grewNormal, frozen, resumed,
|
||||
verdict: (grewNormal && frozen && resumed) ? 'PASS' : 'FAIL' }, null, 2));
|
||||
await b.close();
|
||||
})();
|
||||
Reference in New Issue
Block a user