diff --git a/src/index.html b/src/index.html index a971ac7..be66084 100644 --- a/src/index.html +++ b/src/index.html @@ -127,12 +127,12 @@ - + - +
{m.operand1.input}{m.operand1Binary}{m.operand1.bin.padLeft(m.bitsSize, '0')} {m.operand1.other}
{m.string.replace(/\s/g,'')}={m.result.input}{m.resultBinary}{m.result.bin.padLeft(m.bitsSize, '0')} {m.result.other}
diff --git a/tests/e2e/spec.js b/tests/e2e/spec.js index 76e4204..1b8bf14 100644 --- a/tests/e2e/spec.js +++ b/tests/e2e/spec.js @@ -42,8 +42,6 @@ describe('launch of application', function() { .then(function() { return sendCommand('0x1 0xf')}) .then(function() { return sendCommand('0x1 | 0xf')}) .then(function() { return sendCommand('0x1 ^ 123')}) - .then(function() { return sendCommand('em')}) - .then(function() { return sendCommand('em')}) .then(function() { return sendCommand('dark')}) .then(function() { return sendCommand('light')}) .then(assertNoErrors); @@ -62,8 +60,18 @@ describe('launch of application', function() { }); }); + it('should do a shift operation', function() { - it('should emphasize bytes', function() { + driver.get(appUrl) + .then(function() { + return assertOperation('1<<1', + [{ label: '1', bin:'00000001', other: '0x1'}, + { label: '1<<1=2', bin:'00000010', other: '0x2'}]) + }); + }); + + + xit('should emphasize bytes', function() { driver.get(appUrl) .then(function() { return sendCommand('clear')}) @@ -95,6 +103,7 @@ function assertNoErrors(cmd) { }); } + function assertBitwiseNumbersResults(contaier, array) { return contaier.findElement(By.css('.expression')).then(function (tableExpr){ @@ -124,4 +133,14 @@ function assertSingleRowResult(row, label, bin, other) { expect(tdOther.getText()).toBe(other); }) }); +} + +function assertOperation(op, expected) { + return sendCommand('clear') + .then(function() { return sendCommand(op)}) + .then(assertNoErrors) + .then(function() { + return assertBitwiseNumbersResults(driver, + expected) + }); } \ No newline at end of file