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

Add Tstorish tests #1

Merged
merged 6 commits into from
Mar 27, 2024
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test CI

on:
push:
branches: [main]
tags: ["*"]
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
forge:
name: Run Forge Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install forge dependencies
run: forge install

- name: Run tests
run: FOUNDRY_PROFILE=test forge test -vvv
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
cache/
out/

#foundry test compilation files
cache
out
test-cache

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
Expand All @@ -13,4 +18,4 @@ docs/
# Dotenv file
.env

.DS_Store
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
8 changes: 8 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@ src = "src"
out = "out"
libs = ["lib"]
evm_version = "cancun"
test = 'test/foundry'
remappings = [
'forge-std/=lib/forge-std/src/',
]

[profile.test]
src = 'test/foundry'
cache_path='test-cache'

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at bb4cee
23 changes: 23 additions & 0 deletions test/foundry/TestTstorish.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Test} from "forge-std/Test.sol";

import {Tstorish} from "../../src/Tstorish.sol";

contract TestTstorish is Test {
Tstorish tstorish;

function setUp() public {
_deployTstorish();
}

function _deployTstorish() private {
tstorish = new Tstorish();
}

function testActivateTstore() public {
vm.expectRevert(abi.encodeWithSignature("TStoreAlreadyActivated()"));
tstorish.__activateTstore();
}
}
Loading