update path of test contracts

pull/5370/head
0mkar 6 years ago
parent 27ed38fdf3
commit 94a1edf22b
  1. 4
      remix-resolve/tests/test.js

@ -12,7 +12,7 @@ describe('testRunner', function () {
const content = fs.readFileSync('../remix-resolve/tests/example_1/greeter.sol').toString() const content = fs.readFileSync('../remix-resolve/tests/example_1/greeter.sol').toString()
var sources = [] var sources = []
sources['greeter.sol'] = { 'content': content } sources['greeter.sol'] = { 'content': content }
rr.combineSource('/home/0mkar/Karma/remix/remix-resolve/tests/example_1/', sources) rr.combineSource('../remix-resolve/tests/example_1/', sources)
.then(sources => { .then(sources => {
results = sources results = sources
done() done()
@ -26,7 +26,7 @@ describe('testRunner', function () {
assert.equal(Object.keys(results).length, 2) assert.equal(Object.keys(results).length, 2)
}) })
it('should returns 5 messages', function () { it('should returns 2 contracts with content', function () {
assert.deepEqual(results, { 'mortal.sol':{ content: 'pragma solidity ^0.5.0;\n\ncontract Mortal {\n /* Define variable owner of the type address */\n address payable owner;\n\n /* This function is executed at initialization and sets the owner of the contract */\n function mortal() public { owner = msg.sender; }\n\n /* Function to recover the funds on the contract */\n function kill() public { if (msg.sender == owner) selfdestruct(owner); }\n}\n' }, assert.deepEqual(results, { 'mortal.sol':{ content: 'pragma solidity ^0.5.0;\n\ncontract Mortal {\n /* Define variable owner of the type address */\n address payable owner;\n\n /* This function is executed at initialization and sets the owner of the contract */\n function mortal() public { owner = msg.sender; }\n\n /* Function to recover the funds on the contract */\n function kill() public { if (msg.sender == owner) selfdestruct(owner); }\n}\n' },
'greeter.sol': { content: 'pragma solidity ^0.5.0;\nimport \'mortal.sol\';\n\ncontract Greeter is Mortal {\n /* Define variable greeting of the type string */\n string greeting;\n\n /* This runs when the contract is executed */\n constructor(string memory _greeting) public {\n greeting = _greeting;\n }\n\n /* Main function */\n function greet() public view returns (string memory) {\n return greeting;\n }\n}\n' }}) 'greeter.sol': { content: 'pragma solidity ^0.5.0;\nimport \'mortal.sol\';\n\ncontract Greeter is Mortal {\n /* Define variable greeting of the type string */\n string greeting;\n\n /* This runs when the contract is executed */\n constructor(string memory _greeting) public {\n greeting = _greeting;\n }\n\n /* Main function */\n function greet() public view returns (string memory) {\n return greeting;\n }\n}\n' }})
}) })

Loading…
Cancel
Save