Skip to content

Commit

Permalink
Test left shift for Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
flashultra committed Dec 14, 2024
1 parent 8dcf4e5 commit f851be7
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/unit/src/unit/TestBigInt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@ import haxe.math.bigint.BigInt;
import haxe.math.bigint.BigIntHelper;

class TestBigInt extends Test {


#if lua
public inline function sign(neg:Bool= true):Int {
return (neg) ? -1 : 0;
}

public function testShiftLeft():Void {
trace("===> testShiftLeft()");
trace("sign: "+bigIntShiftLeft());
}

public function bigIntShiftLeft():Int {
trace("sign: "+(sign() << 1));
return (sign() << 1) + 1;
}
#end

public function testBigInt():Void {
MutableBigInt_.s_testAllocation = false;
bigIntAllChecks();
Expand Down

0 comments on commit f851be7

Please sign in to comment.