Skip to content

Commit

Permalink
Merge branch 'main' into hvam/upd1208
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp authored Aug 29, 2024
2 parents f51238b + d48de85 commit 194f1b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/runtime/src/compare/eq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export function eq(
return right.get() === left.get();
} else if (left instanceof Character) {
return (parseInt(left.get(), 10) || 0) === right.get();
} else if (left instanceof String) {
return (parseInt(left.get(), 10) || 0) === right.get();
} else if (left instanceof Float) {
return right.get() === left.getRaw();
} else if (left instanceof Numc) {
Expand Down
13 changes: 13 additions & 0 deletions test/operators/eq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,17 @@ ASSERT 1 = lv_val.`;
}
});

it("integer = string = integer", async () => {
const code = `
DATA num TYPE i.
DATA txt TYPE string.
num = 123.
txt = num.
ASSERT num = txt.
ASSERT txt = num.`;
const js = await run(code);
const f = new AsyncFunction("abap", js);
await f(abap);
});

});

0 comments on commit 194f1b7

Please sign in to comment.