Skip to content
Astera Technology

Test code symbols under the supplied key layout

Interpret physical key labels using their declared mapping.

Download complete case notes and answer keys ↓

Set the decision and its input

Toy layoutL1 maps K1/K2/K3 to A/B;L2 maps the same labels to A-B. Reporting L2 while always applying L1 produces the wrong symbol. Physical key labels alone do not select the code interpretation.

Filled local test worksheet
CaseInput JSON
Base test{"layout":"L2","keys":["K1","K2","K3"]}
Download editable CSV ↓

Run the supplied comparison

The programme executes the supplied mappings only. It makes no claim about an operating system, scanner firmware or locale driver; catalogue admission needs its own code convention.

Faulty and required outputs
PathOutput JSON
Faulty path{"layout":"L2","code":"A/B"}
Required path{"layout":"L2","code":"A-B"}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';

const run=function run(i,corrected=true){
    const layouts={L1:{K1:'A',K2:'/',K3:'B'},L2:{K1:'A',K2:'-',K3:'B'}};
    if(!Object.hasOwn(layouts,i.layout)||i.keys.some(k=>!Object.hasOwn(layouts[i.layout],k)))return {held:true};
    return {layout:i.layout,code:i.keys.map(k=>layouts[corrected?i.layout:'L1'][k]).join('')};
  };
const cases=[{"input":{"layout":"L2","keys":["K1","K2","K3"]},"corrected":false,"expected":{"layout":"L2","code":"A/B"}},{"input":{"layout":"L2","keys":["K1","K2","K3"]},"corrected":true,"expected":{"layout":"L2","code":"A-B"}},{"input":{"layout":"L1","keys":["K1","K2","K3"]},"corrected":true,"expected":{"layout":"L1","code":"A/B"}},{"input":{"layout":null,"keys":["K1"]},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

L1 legitimately produces A/B. An unknown layout or unmapped key is held.

  1. Read the selected layout
  2. Map the complete key sequence
  3. Review the resulting code

Do not infer a real device layout from this toy mapping.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
declared first layout{"layout":"L1","keys":["K1","K2","K3"]}{"layout":"L1","code":"A/B"}
layout not supplied{"layout":null,"keys":["K1"]}{"held":true}
Download editable CSV ↓

What belongs to the baseL2 result?

Show the worked answer

A-B, with layoutL2 retained. A/B belongs to L1 despite identical physical key labels.

Related resources