mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-10 06:52:05 +01:00
19 lines
618 B
JavaScript
19 lines
618 B
JavaScript
var expression = require('../../src/app/expression');
|
|
var parser = expression.parser;
|
|
|
|
describe("operand", function() {
|
|
it("should be able to create opearand from positive binary string", function() {
|
|
var input = "0b10";
|
|
var op = new expression.Operand.parse(input);
|
|
expect(op.value).toBe(2);
|
|
expect(op.kind).toBe('bin');
|
|
});
|
|
|
|
it("should be able to create opearand from negative binary string", function() {
|
|
var input = "-0b10";
|
|
var op = new expression.Operand.parse(input);
|
|
expect(op.value).toBe(-2);
|
|
expect(op.kind).toBe('bin');
|
|
})
|
|
});
|