Skip to content

Commit 89c6d8e

Browse files
committed
Bump latch to v5
1 parent 53c30e2 commit 89c6d8e

8 files changed

Lines changed: 130 additions & 53 deletions

File tree

tests/latch/latch-0.5.0.tgz

55.1 KB
Binary file not shown.

tests/latch/package-lock.json

Lines changed: 116 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/latch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"comptest": "npx ts-node ./src/comp.test.ts"
99
},
1010
"devDependencies": {
11-
"latch": "file:./latch-0.4.3.tgz",
11+
"latch": "file:./latch-0.5.0.tgz",
1212
"mqtt": "^4.3.7",
1313
"serialport": "^10.4.0",
1414
"typescript": "^4.5.5"

tests/latch/src/comp.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "latch";
1212

1313
const framework = Framework.getImplementation();
14-
framework.style(StyleType.github);
14+
framework.reporter.style(StyleType.github)
1515

1616
const suite = framework.suite('Specification test suite for WebAssembly');
1717
suite.testee('emulator [:8500]', new EmulatorSpecification(8500));

tests/latch/src/debugger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const EXAMPLES: string = `${__dirname}/../examples/`;
2626
*/
2727

2828
const framework = Framework.getImplementation();
29-
framework.style(StyleType.github);
29+
framework.reporter.style(StyleType.github)
3030

3131
const integration: Suite = framework.suite('Integration tests: Debugger'); // must be called first
3232

tests/latch/src/primitives.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Type = WASM.Type;
1515
import {Breakpoint} from "latch/dist/types/debug/Breakpoint";
1616

1717
const framework = Framework.getImplementation();
18-
framework.style(StyleType.github);
18+
framework.reporter.style(StyleType.github)
1919

2020
// TODO disclaimer: file is currently disabled until latch supports AS compilation
2121

tests/latch/src/spec.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if (TESTFILE.length > 0) {
5858
// run tests
5959

6060
const framework = Framework.getImplementation();
61-
framework.style(StyleType.github);
61+
framework.reporter.style(StyleType.github)
6262

6363
const spec = framework.suite('Specification test suite for WebAssembly');
6464
spec.testee('emulator [:8500]', new EmulatorSpecification(8500));
@@ -75,8 +75,8 @@ function createTest(module: string, asserts: string[]): TestScenario {
7575
for (const assert of asserts) {
7676
const cursor = {value: 0};
7777
const func: string = find(/invoke "([^"]+)"/, assert);
78-
const args: WASM.Value[] = parseArguments(assert.replace(`(invoke "${func} "`, ''), cursor);
79-
const result: WASM.Value | undefined = parseResult(assert.slice(cursor.value));
78+
const args: WASM.Value<WASM.Type>[] = parseArguments(assert.replace(`(invoke "${func} "`, ''), cursor);
79+
const result: WASM.Value<WASM.Type> | undefined = parseResult(assert.slice(cursor.value));
8080

8181
steps.push({
8282
title: assert,

tests/latch/src/util/spec.util.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface Cursor {
55
value: number;
66
}
77

8-
export function parseResult(input: string): WASM.Value | undefined {
8+
export function parseResult(input: string): WASM.Value<WASM.Type> | undefined {
99
let cursor = 0;
1010
let delta: number = consume(input, cursor, /\(/d);
1111
if (delta === 0) {
@@ -14,13 +14,13 @@ export function parseResult(input: string): WASM.Value | undefined {
1414
cursor += delta;
1515

1616
delta = consume(input, cursor, /^[^.)]*/d);
17-
const type: WASM.Type = WASM.typing.get(input.slice(cursor, cursor + delta)) ?? WASM.Type.i64;
17+
const type: WASM.Type = WASM.typing.get(input.slice(cursor, cursor + delta)) ?? WASM.Integer.i64;
1818

1919
cursor += delta + consume(input, cursor + delta);
2020

2121
let value;
2222
delta = consume(input, cursor, /^[^)]*/d);
23-
if (type === WASM.Type.f32 || type === WASM.Type.f64) {
23+
if (type === WASM.Float.f32 || type === WASM.Float.f64) {
2424
value = parseHexFloat(input.slice(cursor, cursor + delta));
2525
} else {
2626
value = parseInteger(input.slice(cursor, cursor + delta));
@@ -33,8 +33,8 @@ export function parseResult(input: string): WASM.Value | undefined {
3333
return {type, value};
3434
}
3535

36-
export function parseArguments(input: string, index: Cursor): WASM.Value[] {
37-
const args: WASM.Value[] = [];
36+
export function parseArguments(input: string, index: Cursor): WASM.Value<WASM.Type>[] {
37+
const args: WASM.Value<WASM.Type>[] = [];
3838

3939
let cursor: number = consume(input, 0, /invoke "[^"]+"/d);
4040
while (cursor < input.length) {
@@ -45,12 +45,12 @@ export function parseArguments(input: string, index: Cursor): WASM.Value[] {
4545
cursor += delta;
4646

4747
delta = consume(input, cursor, /^[^.)]*/d);
48-
const type: WASM.Type = WASM.typing.get(input.slice(cursor + delta - 3, cursor + delta)) ?? WASM.Type.i64;
48+
const type: WASM.Type = WASM.typing.get(input.slice(cursor + delta - 3, cursor + delta)) ?? WASM.Integer.i64;
4949

5050
cursor += delta + consume(input, cursor + delta, /^[^)]*const /d);
5151
delta = consume(input, cursor, /^[^)]*/d);
5252
let maybe: number | undefined;
53-
if (type === WASM.Type.f32 || type === WASM.Type.f64) {
53+
if (type === WASM.Float.f32 || type === WASM.Float.f64) {
5454
maybe = parseHexFloat(input.slice(cursor, cursor + delta));
5555
} else {
5656
maybe = parseInteger(input.slice(cursor, cursor + delta));

0 commit comments

Comments
 (0)