29 lines
5.2 KiB
JavaScript
29 lines
5.2 KiB
JavaScript
'use strict';
|
|
const {assert,functionSource,app,css,html,read,loadBendPuzzle,root,fs,path,buildMeta}=require('./helpers/app-source');
|
|
assert(buildMeta.APP_VERSION==='48.0'&&buildMeta.PACKAGE_VERSION==='48.0.0','Version was not advanced to v47.84');
|
|
assert(functionSource('makeBoard').includes('board-input-clip-')&&functionSource('renderBoardNow').includes("'clip-path':`url(#${b.inputClipId})`") ,'Endpoint hit regions are not clipped to their owning board');
|
|
assert(functionSource('sharedBoundaryColorIndex').includes('boundaryColorSource')&&functionSource('renderBoardNow').includes('sharedBoundaryColorIndex(meta,i)'),'Facing gate colors are not unified');
|
|
assert(functionSource('renderBoardNow').includes('else renderDragFrame(b)'),'Stationary drag cursor is not restored after a full board redraw');
|
|
assert(functionSource('bindBoard').includes('b.drawing=null;b.armedGate=null')&&!functionSource('bindBoard').includes('b.drawing.pointerId=e.pointerId'),'Released drawings can still be resumed from unrelated cells');
|
|
assert(functionSource('radialReactionIndex').includes('bestDistance')&&functionSource('beginReactionGesture').includes('setPointerCapture')&&app.includes("window.addEventListener('pointermove',moveReactionGesture,true)"),'Radial hold-drag-release selection is incomplete');
|
|
assert(html.includes('id="settingsBtn"')&&html.includes('id="settingsPlayerName"')&&html.includes('id="lightweightRenderingToggle"')&&html.includes('id="soundEnabledToggle"')&&functionSource('saveSettings').includes('commitPlayerProfileName')&&functionSource('commitPlayerProfileName').includes('/api/cloud/profile')&&functionSource('init').includes('createAutomaticPlayerName'),'Settings-based player naming, rendering, sound, or automatic initial name is missing');
|
|
assert(functionSource('soundTone').includes('if(!uiSettings.soundEnabled)return')&&functionSource('applyUiSettings').includes("classList.toggle('lightweight-rendering'"),'Settings are not applied to sound and rendering');
|
|
assert(functionSource('renderBoardNow').includes('st.solvedBy!==LEGACY_LOCAL_SOLVER'),'Legacy 「あなた」 solver labels are still displayed');
|
|
assert(css.includes('.solver-badge strong{display:block;max-width:100%;white-space:nowrap')&&css.includes('text-overflow:ellipsis'),'Solver names can still wrap repeatedly');
|
|
assert(functionSource('positionBoardLabel').includes('viewportRect.height-margin-labelHeight')&&functionSource('makeBoard').includes('boardHudLayer?.append(label)'),'Board HUD is not detached and clamped to the viewport');
|
|
assert(css.includes('#customEmojiCursor.flag-cursor img{position:absolute;left:50%;top:50%')&&css.includes('transform:translate(-50%,-50%)'),'Flag cursor is not centered');
|
|
assert(css.includes('.fps-stat{position:fixed')&&css.includes('background:none')&&css.includes('font-size:8px'),'FPS display is not subtle and background-free');
|
|
assert(html.includes('長くつながって太くなった線ほど高得点です。'),'Help does not explain long/thick-line scoring');
|
|
assert(functionSource('rebuildMinimapWorld').includes('drawMapBoardCells')&&!functionSource('drawMapBoardCells').includes('stroke('),'Minimap board outlines are still drawn');
|
|
assert(functionSource('rebuildWorldOverviewCache').includes('drawMapBoardCells')&&functionSource('rebuildWorldOverviewCache').includes('drawMapLongLines')&&!app.includes('function drawWorldOverviewShops('),'Zoomed-out rendering does not match the minimap');
|
|
assert(functionSource('maybeGrantGenerationFailureBonus').includes('GENERATION_FAILURE_MIN_MS')&&functionSource('maybeGrantGenerationFailureBonus').includes('unresolvedExpansionCandidates(meta).length'),'Generation failure bonus is not limited to long unresolved expansion attempts');
|
|
const server=`${read('server.js')}\n${read('server/player-service.js')}`;assert(server.includes("row.state.expanded===true")&&server.includes("Expansion already succeeded")&&server.includes('GENERATION_FAILURE_BONUS = 2500'),'Generation bonus server guard or level-6-equivalent amount is missing');
|
|
const internal=read('docs/internal-system.md');assert(internal.includes('Do not add changelog')&&internal.includes('update the relevant current specification in place'),'Documentation policy does not prohibit update-history documents');
|
|
for(const name of fs.readdirSync(path.join(root,'docs')))assert(!/(changelog|release|history|update|v\d+|phase\d+)/i.test(name),`Historical update document remains: ${name}`);
|
|
const BendPuzzle=loadBendPuzzle();let hasLevel10Region=false,hasLevel6Region=false;
|
|
for(let y=-100;y<=100;y++)for(let x=-100;x<=100;x++){const level=BendPuzzle.macroDifficulty(x,y);if(level>=6)hasLevel6Region=true;if(level===10)hasLevel10Region=true}
|
|
assert(hasLevel6Region&&hasLevel10Region,'World difficulty map still lacks level 6+ or level 10 regions');
|
|
const high=BendPuzzle.generatePuzzle([[0,0],[1,0],[0,1]],987654,6,12,-9);
|
|
assert(high.difficulty===6&&high.complexity.rawRating>=6,'Level-6 regional generation is still discarded or misclassified');
|
|
assert(functionSource('normalizeStoredPuzzle').includes('solverDifficulty(puzzle,targetLevel)'),'Stored high-level boards lose their regional level after reload');
|
|
console.log('v47.84 settings, map rendering, generation bonus, docs policy, and high-level generation regression test passed');
|