This commit is contained in:
10 files changed
+24
-24
No files matched your search
@@ -191,10 +191,10 @@ test('Mojo beside x86-64: the line table the compiler left in the pane links eac
|
||||
// a real listing, as Open in Hardware makes it from godbolt's saved answer
|
||||
const ROOT = new URL('..', import.meta.url).pathname;
|
||||
let checked = 0;
|
||||
for (const f of fs.readdirSync(ROOT + 'core/mojo/probes').filter((x) => x.endsWith('.mojo'))) {
|
||||
const text = fs.readFileSync(ROOT + 'core/mojo/probes/' + f, 'utf8');
|
||||
for (const f of fs.readdirSync(ROOT + 'core/library/mojo/probes').filter((x) => x.endsWith('.mojo'))) {
|
||||
const text = fs.readFileSync(ROOT + 'core/library/mojo/probes/' + f, 'utf8');
|
||||
if (!/^# mode: (asm|both)/m.test(text)) continue;
|
||||
const r = buildListing(text, ROOT + 'core/mojo/golden', { forSimulator, simulatorSetup, listingFunctions });
|
||||
const r = buildListing(text, ROOT + 'core/library/mojo/golden', { forSimulator, simulatorSetup, listingFunctions });
|
||||
if (r.why) continue;
|
||||
const table = asmMojoLines(r.asm);
|
||||
if (!table.size) continue;
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import { normalize } from '../dist/core/state.js';
|
||||
import { Session } from '../dist/core/session.js';
|
||||
|
||||
// godbolt's stored answers, in pplus-core
|
||||
const goldens = fs.readdirSync(new URL('../core/mojo/golden/', import.meta.url)).filter((f) => /^[0-9a-f]{64}\.json$/.test(f))
|
||||
.map((f) => JSON.parse(fs.readFileSync(new URL(`../core/mojo/golden/${f}`, import.meta.url), 'utf8')));
|
||||
const goldens = fs.readdirSync(new URL('../core/library/mojo/golden/', import.meta.url)).filter((f) => /^[0-9a-f]{64}\.json$/.test(f))
|
||||
.map((f) => JSON.parse(fs.readFileSync(new URL(`../core/library/mojo/golden/${f}`, import.meta.url), 'utf8')));
|
||||
|
||||
test('the session keeps each answer with the source it answered, and says when it is stale', async () => {
|
||||
const s = new Session(normalize({ v: 3, lang: 'mojo', sources: { mojo: 'fn main():\n print(1)\n' } }));
|
||||
|
||||
@@ -121,7 +121,7 @@ test('every rendered view draws for a program that has what it needs, with the a
|
||||
assert.match(tests.html, /way of failing/);
|
||||
const machine = renderStatic({ view: 'machine', files: { asm: problemById('asm-two-pointers').sources.asm }, setup: problemById('asm-two-pointers').setup });
|
||||
assert.match(machine.markdown, /\| instructions \| \d+ \|/);
|
||||
const life = renderStatic({ view: 'life', files: { mojo: fs.readFileSync(ROOT + 'core/mojo/stress/lifecycle-moves.mojo', 'utf8') } });
|
||||
const life = renderStatic({ view: 'life', files: { mojo: fs.readFileSync(ROOT + 'core/library/mojo/stress/lifecycle-moves.mojo', 'utf8') } });
|
||||
assert.ok((life.html.match(/life-row/g) ?? []).length >= 3);
|
||||
assert.doesNotMatch(life.html, /Click a mark/, 'a page has no stepper to move');
|
||||
assert.equal(STATIC_VIEWS.length, 12);
|
||||
|
||||
Reference in new issue
Block a user