diff --git a/.circleci/config.yml b/.circleci/config.yml index ad0a4e36e0..b8190142d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,15 @@ jobs: steps: - checkout - run: cd remix-solidity && npm install && npm test + + remix-debug: + docker: + - image: circleci/node:7.10 + environment: + working_directory: ~/repo + steps: + - checkout + - run: cd remix-debug && npm install && npm test workflows: version: 2 @@ -38,4 +47,5 @@ workflows: - remix-lib - remix-core - remix-solidity + - remix-debug diff --git a/remix-debug/test/tests.js b/remix-debug/test/tests.js index b54254b406..23e33ca556 100644 --- a/remix-debug/test/tests.js +++ b/remix-debug/test/tests.js @@ -8,6 +8,7 @@ var Debugger = require('../src/Ethdebugger') var compiler = require('solc') tape('debug contract', function (t) { + t.plan(12) var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var vm = vmCall.initVM(t, privateKey) var output = compiler.compileStandardWrapper(compilerInput(ballot)) @@ -95,16 +96,22 @@ function testDebugging (t, debugManager) { var sourceMappingDecoder = new remixLib.SourceMappingDecoder() var breakPointManager = new remixCore.code.BreakpointManager(debugManager, (rawLocation) => { - return sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, ballot) + return sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, sourceMappingDecoder.getLinebreakPositions(ballot)) }) - breakPointManager.add({fileName: 'test.sol', row: 24}) + breakPointManager.add({fileName: 'test.sol', row: 23}) breakPointManager.event.register('breakpointHit', function (sourceLocation, step) { - t.equal(sourceLocation, '') - t.equal(step, 67) + console.log('breakpointHit') + t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 591, length: 1, file: 0, jump: '-' })) + t.equal(step, 73) }) - breakPointManager.jumpNextBreakpoint(true) + + breakPointManager.event.register('noBreakpointHit', function () { + t.end('noBreakpointHit') + console.log('noBreakpointHit') + }) + breakPointManager.jumpNextBreakpoint(0, true) } var ballot = `pragma solidity ^0.4.0;