From c03aae9765e93f2715c20946f5df2b8fce0836cf Mon Sep 17 00:00:00 2001 From: 0mkar <0mkar@protonmail.com> Date: Wed, 21 Nov 2018 17:48:36 +0530 Subject: [PATCH] add tests --- remix-resolve/tests/example_1/greeter.sol | 17 +++++++++++++++++ remix-resolve/tests/example_1/mortal.sol | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 remix-resolve/tests/example_1/greeter.sol create mode 100644 remix-resolve/tests/example_1/mortal.sol diff --git a/remix-resolve/tests/example_1/greeter.sol b/remix-resolve/tests/example_1/greeter.sol new file mode 100644 index 0000000000..8425568af9 --- /dev/null +++ b/remix-resolve/tests/example_1/greeter.sol @@ -0,0 +1,17 @@ +pragma solidity ^0.5.0; +import "./mortal.sol"; + +contract Greeter is Mortal { + /* Define variable greeting of the type string */ + string greeting; + + /* This runs when the contract is executed */ + constructor(string memory _greeting) public { + greeting = _greeting; + } + + /* Main function */ + function greet() public view returns (string memory) { + return greeting; + } +} diff --git a/remix-resolve/tests/example_1/mortal.sol b/remix-resolve/tests/example_1/mortal.sol new file mode 100644 index 0000000000..e1a1fa4de8 --- /dev/null +++ b/remix-resolve/tests/example_1/mortal.sol @@ -0,0 +1,12 @@ +pragma solidity ^0.5.0; + +contract Mortal { + /* Define variable owner of the type address */ + address payable owner; + + /* This function is executed at initialization and sets the owner of the contract */ + function mortal() public { owner = msg.sender; } + + /* Function to recover the funds on the contract */ + function kill() public { if (msg.sender == owner) selfdestruct(owner); } +}