Test updates

This commit is contained in:
0xd4d 2020-04-14 20:54:42 +02:00
parent 5df6c65077
commit b97ff1c504
5 changed files with 8 additions and 3 deletions

View File

@ -276,7 +276,7 @@ jobs:
wasm-pack build --mode force --target nodejs
cd src/tests
npm install
npm run test
npm test
cd ..
git clean -xdf

View File

@ -56,7 +56,7 @@ cd src/rust/iced-x86-js
wasm-pack build --mode force --target nodejs
cd src/tests
npm install
npm run test
npm test
```
## Feature flags

View File

@ -216,7 +216,7 @@ test("Decode with DecoderOptions.AmdBranches", () => {
});
test("Creating a Decoder with an invalid bitness throws", () => {
expect(() => new Decoder(63, new Uint8Array([0x90], DecoderOptions.None))).toThrow();
expect(() => new Decoder(63, new Uint8Array([0x90]), DecoderOptions.None)).toThrow();
});
// Make sure it's not an enum arg in the Rust code since it's a flags enum. It must be a u32 in the method sig.

View File

@ -268,6 +268,7 @@ test("Format instruction: gas", () => {
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic)).toBe("");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoPrefixes)).toBe("vcvtne2ps2bf16");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic | FormatMnemonicOptions.NoPrefixes)).toBe("");
expect(formatter.formatMnemonic(instr2)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.None)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoMnemonic)).toBe("lock");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoPrefixes)).toBe("add");
@ -314,6 +315,7 @@ test("Format instruction: Intel", () => {
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic)).toBe("");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoPrefixes)).toBe("vcvtne2ps2bf16");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic | FormatMnemonicOptions.NoPrefixes)).toBe("");
expect(formatter.formatMnemonic(instr2)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.None)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoMnemonic)).toBe("lock");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoPrefixes)).toBe("add");
@ -360,6 +362,7 @@ test("Format instruction: masm", () => {
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic)).toBe("");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoPrefixes)).toBe("vcvtne2ps2bf16");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic | FormatMnemonicOptions.NoPrefixes)).toBe("");
expect(formatter.formatMnemonic(instr2)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.None)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoMnemonic)).toBe("lock");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoPrefixes)).toBe("add");
@ -406,6 +409,7 @@ test("Format instruction: nasm", () => {
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic)).toBe("");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoPrefixes)).toBe("vcvtne2ps2bf16");
expect(formatter.formatMnemonicOptions(instr, FormatMnemonicOptions.NoMnemonic | FormatMnemonicOptions.NoPrefixes)).toBe("");
expect(formatter.formatMnemonic(instr2)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.None)).toBe("lock add");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoMnemonic)).toBe("lock");
expect(formatter.formatMnemonicOptions(instr2, FormatMnemonicOptions.NoPrefixes)).toBe("add");

View File

@ -123,6 +123,7 @@ test("Instruction props", () => {
expect(instr.conditionCode).toBe(ConditionCode.None);
const instr2 = instr.clone();
expect(instr).not.toBe(instr2);
expect(instr.equalsAllBits(instr2)).toBe(true);
expect(instr.equals(instr2)).toBe(true);