From c71ac355748eba81bf76838192136db843f3d940 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Wed, 21 Nov 2018 20:53:20 +0100 Subject: [PATCH] fixes generate tests for solc 0.5.0 --- src/app/tabs/test-tab.js | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index cdaebb0067..beb22dd5a2 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -193,42 +193,42 @@ module.exports = class TestTab { } } -var testContractSample = `pragma solidity ^0.4.0; +var testContractSample = ` import "remix_tests.sol"; // this import is automatically injected by Remix. // file name has to end with '_test.sol' contract test_1 { - - function beforeAll() public { - // here should instantiate tested contract - } - - function check1() public { - // this function is not constant, use 'Assert' to test the contract - Assert.equal(uint(2), uint(1), "error message"); - Assert.equal(uint(2), uint(2), "error message"); - } - - function check2() public constant returns (bool) { - // this function is constant, use the return value (true or false) to test the contract - return true; - } + + function beforeAll() public pure { + // here should instantiate tested contract + } + + function check1() public { + // use 'Assert' to test the contract + Assert.equal(uint(2), uint(1), "error message"); + Assert.equal(uint(2), uint(2), "error message"); + } + + function check2() pure public returns (bool) { + // use the return value (true or false) to test the contract + return true; + } } contract test_2 { - - function beforeAll() public { - // here should instantiate tested contract - } - - function check1() public { - // this function is not constant, use 'Assert' to test the contract - Assert.equal(uint(2), uint(1), "error message"); - Assert.equal(uint(2), uint(2), "error message"); - } - - function check2() public constant returns (bool) { - // this function is constant, use the return value (true or false) to test the contract - return true; - } + + function beforeAll() public pure { + // here should instantiate tested contract + } + + function check1() public { + // use 'Assert' to test the contract + Assert.equal(uint(2), uint(1), "error message"); + Assert.equal(uint(2), uint(2), "error message"); + } + + function check2() public pure returns (bool) { + // use the return value (true or false) to test the contract + return true; + } }`