Skip to content

Commit

Permalink
extend test coverage for xor
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Apr 19, 2024
1 parent 1ce0686 commit a3857d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/feature-constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ describe("feature-constants", () => {
expect((await contract.getSomething10()).toRawString()).toEqual(
"0:4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873",
);
expect(await contract.getSomething11()).toEqual(88n);
expect(await contract.getSomething12()).toEqual(-90n);
expect(await contract.getSomething13()).toEqual(88n);
expect(await contract.getGlobalConst()).toEqual(100n);
});
});
3 changes: 3 additions & 0 deletions src/test/feature-math.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ describe("feature-math", () => {
expect(await contract.getAnd(2n, 3n)).toBe(2n);
expect(await contract.getOr(2n, 3n)).toBe(3n);
expect(await contract.getXor(2n, 3n)).toBe(1n);
expect(await contract.getXor(2n, -3n)).toBe(-1n);
expect(await contract.getXor(-2n, 3n)).toBe(-3n);
expect(await contract.getXor(-2n, -3n)).toBe(3n);

// Augmented Assign
expect(await contract.getAddAug(1n, 2n)).toBe(3n);
Expand Down
15 changes: 15 additions & 0 deletions src/test/features/constants.tact
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ contract ConstantTester {
const something8: Int = (2 + 4) & 4;
const something9: Address = address("UQBKgXCNLPexWhs2L79kiARR1phGH1LwXxRbNsCFF9doczSI");
const something10: Address = newAddress(0, 0x4a81708d2cf7b15a1b362fbf64880451d698461f52f05f145b36c08517d76873);
const something11: Int = 123 ^ 35;
const something12: Int = -123 ^ 35;
const something13: Int = -123 ^ -35;

init() {

Expand Down Expand Up @@ -60,6 +63,18 @@ contract ConstantTester {
return self.something10;
}

get fun something11(): Int {
return self.something11;
}

get fun something12(): Int {
return self.something12;
}

get fun something13(): Int {
return self.something13;
}

get fun globalConst(): Int {
return someGlobalConst;
}
Expand Down

0 comments on commit a3857d8

Please sign in to comment.