Skip to content

Commit

Permalink
unit test skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
amiecorso committed Oct 8, 2024
1 parent 579ec73 commit 1ee5491
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ node/package-lock.json

# macOS
.DS_Store

# vsCode
.vscode
16 changes: 16 additions & 0 deletions test/src/SpendPermissions/isAuthorized.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

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

import {SpendPermissionsBase} from "../../base/SpendPermissionsBase.sol";

contract IsAuthorizedTest is Test, SpendPermissionsBase {
function setUp() public {
_initializeSpendPermissions();
}
function test_isAuthorized_success_true() public {}
function test_isAuthorized_success_false() public {}
}
17 changes: 17 additions & 0 deletions test/src/SpendPermissions/permit.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

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

import {SpendPermissionsBase} from "../../base/SpendPermissionsBase.sol";

contract PermitTest is Test, SpendPermissionsBase {
function setUp() public {
_initializeSpendPermissions();
}

function test_permit_revert_unauthorizedRecurringAllowance() public {}
function test_permit_success() public {}
}
17 changes: 17 additions & 0 deletions test/src/SpendPermissions/revoke.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

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

import {SpendPermissionsBase} from "../../base/SpendPermissionsBase.sol";

contract RevokeTest is Test, SpendPermissionsBase {
function setUp() public {
_initializeSpendPermissions();
}

function test_revoke_revert_invalidSender() public {}
function test_revoke_success() public {}
}
20 changes: 20 additions & 0 deletions test/src/SpendPermissions/withdraw.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

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

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

import {SpendPermissionsBase} from "../../base/SpendPermissionsBase.sol";

contract WithdrawTest is Test, SpendPermissionsBase {
function setUp() public {
_initializeSpendPermissions();
}

// TODO best way to indicate the two different versions of `withdraw` in test names?
function test_withdraw_revert_invalidSender() public {}
function test_withdraw_revert_unauthorizedRecurringAllowance() public {}
function test_withdraw_success_ether() public {}
function test_withdraw_success_ERC20() public {}
}

0 comments on commit 1ee5491

Please sign in to comment.