diff --git a/remix-tests/src/testRunner.js b/remix-tests/src/testRunner.js index 7c804b91c9..ee2a385ea5 100644 --- a/remix-tests/src/testRunner.js +++ b/remix-tests/src/testRunner.js @@ -13,7 +13,9 @@ function getFunctionFullName (signature, methodIdentifiers) { function getOverridedSender (userdoc, signature, methodIdentifiers) { let fullName = getFunctionFullName(signature, methodIdentifiers) - return fullName && userdoc.methods[fullName] ? userdoc.methods[fullName].notice : null + let match = /sender: account-+(\d)/g + let accountIndex = userdoc.methods[fullName] ? match.exec(userdoc.methods[fullName].notice) : null + return fullName && accountIndex ? accountIndex[1] : null } function getAvailableFunctions (jsonInterface) { diff --git a/remix-tests/tests/various_sender/sender_test.sol b/remix-tests/tests/various_sender/sender_test.sol index a8ee001b3d..6147457bc3 100644 --- a/remix-tests/tests/various_sender/sender_test.sol +++ b/remix-tests/tests/various_sender/sender_test.sol @@ -2,25 +2,25 @@ import "remix_tests.sol"; // this import is automatically injected by Remix. import "remix_accounts.sol"; contract SenderTest { - + function beforeAll () public {} - - /// 1 + + /// sender: account-1 function checkSenderIs1 () public { Assert.equal(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIs1"); } - - /// 0 + + /// sender: account-0 function checkSenderIs0 () public { Assert.equal(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIs0"); } - /// 1 + /// sender: account-1 function checkSenderIsNt0 () public { Assert.notEqual(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIsNot0"); } - /// 2 + /// sender: account-2 function checkSenderIsnt2 () public { Assert.notEqual(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIsnt2"); }