Commit 20df4ba6 authored by yann300's avatar yann300

fix#943

parent 4f5fe95b
...@@ -27,6 +27,7 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number, ...@@ -27,6 +27,7 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number,
.click('*[data-id="treeViewDivcompiler"]') .click('*[data-id="treeViewDivcompiler"]')
.waitForElementVisible('*[data-id="treeViewLicompiler/version"]') .waitForElementVisible('*[data-id="treeViewLicompiler/version"]')
.assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`) .assert.containsText('*[data-id="treeViewLicompiler/version"]', `version:\n ${opts.version}`)
.modalFooterCancelClick()
.perform(done) .perform(done)
} else done() } else done()
}) })
......
...@@ -52,6 +52,16 @@ module.exports = { ...@@ -52,6 +52,16 @@ module.exports = {
.pause(5000) .pause(5000)
.addFile('test_updateConfiguration.sol', { content: simpleContract }) .addFile('test_updateConfiguration.sol', { content: simpleContract })
.verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' }) .verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' })
},
'Should produce a stack too deep error': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('fileExplorers')
.click('li[data-id="treeViewLitreeViewItemREADME.txt"')
.addFile('ContractStackLimit.sol', { content: contractStackLimit })
.clickLaunchIcon('solidity')
.waitForElementPresent('[data-id="compiledErrors"] div:nth-child(2)', 45000)
.waitForElementContainsText('*[data-id="compiledErrors"]', 'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.')
.end() .end()
}, },
...@@ -156,3 +166,12 @@ const updateConfiguration = `(async () => { ...@@ -156,3 +166,12 @@ const updateConfiguration = `(async () => {
console.log(e.message) console.log(e.message)
} }
})()` })()`
const contractStackLimit = `
//SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.1;
contract DoesNotCompile {
uint u;
function fStackLimit(uint u1, uint u2, uint u3, uint u4, uint u5, uint u6, uint u7, uint u8, uint u9, uint u10, uint u11, uint u12) public {
}
}`
...@@ -112,7 +112,7 @@ Renderer.prototype.error = function (message, container, opt) { ...@@ -112,7 +112,7 @@ Renderer.prototype.error = function (message, container, opt) {
// Updated error reported includes '-->' before file details // Updated error reported includes '-->' before file details
const errorDetails = text.split('-->') const errorDetails = text.split('-->')
// errorDetails[1] will have file details // errorDetails[1] will have file details
position = getPositionDetails(errorDetails[1]) if (errorDetails.length > 1) position = getPositionDetails(errorDetails[1])
} }
opt.errLine = position.errLine opt.errLine = position.errLine
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment