Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new function and test for it #424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/MyContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// src/MyContract.sol
pragma solidity ^0.8.0;

contract MyContract {
// Existing functions and variables

function newFunction() public pure returns (string memory) {
return "Hello, Farcaster!";
}
}
18 changes: 18 additions & 0 deletions test/TestMyContract.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// test/TestMyContract.t.sol
pragma solidity ^0.8.0;

import "forge-std/Test.sol";
import "../src/MyContract.sol";

contract TestMyContract is Test {
MyContract myContract;

function setUp() public {
myContract = new MyContract();
}

function testNewFunction() public {
string memory result = myContract.newFunction();
assertEq(result, "Hello, Farcaster!");
}
}