mirror of
https://github.com/ruvnet/RuView.git
synced 2026-10-23 07:02:44 -05:00
Integrate reviewed source PRs #2201-#2223, #2225-#2231, #2235-#2240, #2242 and #2243 (firmware README hunks remain in #2247). Regenerate one package manifest after integration, validate native Windows test execution, bound MTK listener startup, support official C6 release bundles, and retain stronger release metadata gates.
35 lines
1.5 KiB
JavaScript
35 lines
1.5 KiB
JavaScript
import { python } from './helpers/python.mjs';
|
|
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { mkdtempSync, writeFileSync, readFileSync, linkSync, symlinkSync, rmSync } from 'node:fs';
|
|
import { tmpdir } from 'node:os';
|
|
import { join } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { spawnSync } from 'node:child_process';
|
|
const script=fileURLToPath(new URL('../../../scripts/esp32_jsonl_to_rvcsi.py',import.meta.url));
|
|
for(const alias of ['identical path','hard link','symbolic link']){
|
|
test(`public converter CLI preserves source capture when output is ${alias}`,t=>{
|
|
const dir=mkdtempSync(join(tmpdir(),'ruview-transcode-source-'));
|
|
try{
|
|
const input=join(dir,'input.csi.jsonl');let output=input;
|
|
const original=JSON.stringify({type:'raw_csi',iq_hex:'0304',rssi:-50,ts_ns:123,channel:6})+'\n';writeFileSync(input,original);
|
|
if(alias!=='identical path'){
|
|
output=join(dir,'output.rvcsi');
|
|
if(alias==='hard link')linkSync(input,output);
|
|
else {
|
|
try { symlinkSync(input,output); }
|
|
catch(error) {
|
|
if(process.platform==='win32' && error.code==='EPERM'){
|
|
t.skip('Windows account lacks file symlink privilege'); return;
|
|
}
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
const r=spawnSync(python,[script,input,output],{encoding:'utf8'});
|
|
assert.equal(readFileSync(input,'utf8'),original,'input capture must remain byte-for-byte intact');
|
|
assert.equal(r.status,2);assert.match(r.stderr,/different files/i);
|
|
}finally{rmSync(dir,{recursive:true,force:true});}
|
|
});
|
|
}
|