Skip to content

Commit

Permalink
refactor: move test dir to root
Browse files Browse the repository at this point in the history
  • Loading branch information
mds1 committed Oct 6, 2022
1 parent 24f8c2b commit f21ef1a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/test/StdAssertions.t.sol → test/StdAssertions.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../Test.sol";
import "src/Test.sol";

contract StdAssertionsTest is Test {
string constant CUSTOM_ERROR = "guh!";
Expand Down
16 changes: 8 additions & 8 deletions src/test/StdCheats.t.sol → test/StdCheats.t.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../StdCheats.sol";
import "../Test.sol";
import "../StdJson.sol";
import "src/StdCheats.sol";
import "src/Test.sol";
import "src/StdJson.sol";

contract StdCheatsTest is Test {
Bar test;
Expand Down Expand Up @@ -169,7 +169,7 @@ contract StdCheatsTest is Test {

function testParseJsonTxDetail() public {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory path = string.concat(root, "/test/fixtures/broadcast.log.json");
string memory json = vm.readFile(path);
bytes memory transactionDetails = json.parseRaw(".transactions[0].tx");
RawTx1559Detail memory rawTxDetail = abi.decode(transactionDetails, (RawTx1559Detail));
Expand All @@ -185,20 +185,20 @@ contract StdCheatsTest is Test {

function testReadEIP1559Transaction() public {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory path = string.concat(root, "/test/fixtures/broadcast.log.json");
uint256 index = 0;
Tx1559 memory transaction = readTx1559(path, index);
}

function testReadEIP1559Transactions() public {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory path = string.concat(root, "/test/fixtures/broadcast.log.json");
Tx1559[] memory transactions = readTx1559s(path);
}

function testReadReceipt() public {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory path = string.concat(root, "/test/fixtures/broadcast.log.json");
uint index = 5;
Receipt memory receipt = readReceipt(path, index);
assertEq(receipt.logsBloom,
Expand All @@ -207,7 +207,7 @@ contract StdCheatsTest is Test {

function testReadReceipts() public {
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/src/test/fixtures/broadcast.log.json");
string memory path = string.concat(root, "/test/fixtures/broadcast.log.json");
Receipt[] memory receipts = readReceipts(path);
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/StdError.t.sol → test/StdError.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import "../StdError.sol";
import "../Test.sol";
import "src/StdError.sol";
import "src/Test.sol";

contract StdErrorsTest is Test {
ErrorsTest test;
Expand Down
4 changes: 2 additions & 2 deletions src/test/StdMath.t.sol → test/StdMath.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import "../StdMath.sol";
import "../Test.sol";
import "src/StdMath.sol";
import "src/Test.sol";

contract StdMathTest is Test {
function testGetAbs() external {
Expand Down
8 changes: 4 additions & 4 deletions src/test/StdStorage.t.sol → test/StdStorage.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../StdStorage.sol";
import "../Test.sol";
import "src/StdStorage.sol";
import "src/Test.sol";

contract StdStorageTest is Test {
using stdStorage for StdStorage;
Expand Down Expand Up @@ -213,7 +213,7 @@ contract StdStorageTest is Test {
function testFailStorageNativePack() public {
stdstore.target(address(test)).sig(test.tA.selector).find();
stdstore.target(address(test)).sig(test.tB.selector).find();

// these both would fail
stdstore.target(address(test)).sig(test.tC.selector).find();
stdstore.target(address(test)).sig(test.tD.selector).find();
Expand Down Expand Up @@ -274,7 +274,7 @@ contract StorageTest {


bool public tC = false;
uint248 public tD = 1;
uint248 public tD = 1;


struct UnpackedStruct {
Expand Down
2 changes: 1 addition & 1 deletion src/test/StdUtils.t.sol → test/StdUtils.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../Test.sol";
import "src/Test.sol";

contract StdUtilsTest is Test {
function testBound() public {
Expand Down
File renamed without changes.

0 comments on commit f21ef1a

Please sign in to comment.