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

Update command outputs #612

Merged
merged 8 commits into from
Sep 9, 2022
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
4 changes: 2 additions & 2 deletions src/output/cheatcodes/forge-test-cheatcodes-tracing
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Traces:
[8413] OwnerUpOnlyTest::testFailIncrementAsNotOwner()
├─ [0] VM::prank(0x0000000000000000000000000000000000000000)
│ └─ ← ()
├─ [247] 0xce71…c246::d09de08a()
├─ [247] 0xce71…c246::increment()
│ └─ ← 0x82b42900
└─ ← 0x82b42900

Test result: ok. 1 passed; 0 failed; finished in 677.31µs
Test result: ok. 1 passed; 0 failed; finished in 2.01ms
// ANCHOR_END: output
// ANCHOR_END: all
3 changes: 2 additions & 1 deletion src/output/cheatcodes/forge-test-simple
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ $ forge test --match-test testIncrementAsOwner
// ANCHOR_END: command
// ANCHOR: output
Compiling 7 files with 0.8.10
Solc 0.8.10 finished in 4.25s
Compiler run successful

Running 1 test for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest
[PASS] testIncrementAsOwner() (gas: 29162)
Test result: ok. 1 passed; 0 failed; finished in 723.90µs
Test result: ok. 1 passed; 0 failed; finished in 928.64µs
// ANCHOR_END: output
// ANCHOR_END: all
2 changes: 1 addition & 1 deletion src/output/deps/forge-install
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$ forge install transmissions11/solmate
// ANCHOR_END: command
// ANCHOR: output
Installing solmate in "/tmp/tmp.cCYDqfwRJM/deps/lib/solmate", (url: https://github.com/transmissions11/solmate, tag: None)
Installing solmate in "/private/var/folders/p_/xbvs4ns92wj3b9xmkc1zkw2w0000gn/T/tmp.FRH0gNvz/deps/lib/solmate" (url: Some("https://github.com/transmissions11/solmate"), tag: None)
Installed solmate
// ANCHOR_END: output
// ANCHOR_END: all
2 changes: 1 addition & 1 deletion src/output/deps/forge-remappings
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$ forge remappings
// ANCHOR_END: command
// ANCHOR: output
ds-test/=lib/solmate/lib/ds-test/src/
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
solmate/=lib/solmate/src/
weird-erc20/=lib/weird-erc20/src/
Expand Down
3 changes: 2 additions & 1 deletion src/output/femplate/forge-build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$ forge build
// ANCHOR_END: command
// ANCHOR: output
Compiling 6 files with 0.8.13
Compiling 10 files with 0.8.15
Solc 0.8.15 finished in 4.35s
Compiler run successful
// ANCHOR_END: output
// ANCHOR_END: all
7 changes: 3 additions & 4 deletions src/output/femplate/forge-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ $ forge test
// ANCHOR: output
No files changed, compilation skipped

Running 2 tests for src/test/Greeter.t.sol:GreeterTest
[PASS] testExpectArithmetic() (gas: 8802)
[PASS] testSetGm() (gas: 112032)
Test result: ok. 2 passed; 0 failed; finished in 1.42ms
Running 1 test for test/Greeter.t.sol:GreeterTest
[PASS] testSetGm() (gas: 107402)
Test result: ok. 1 passed; 0 failed; finished in 4.77ms
// ANCHOR_END: output
// ANCHOR_END: all
21 changes: 10 additions & 11 deletions src/output/forge_tree/forge-tree
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ src/SolmateNft.sol 0.8.10
├── lib/openzeppelin-contracts/contracts/utils/Strings.sol ^0.8.0
├── lib/openzeppelin-contracts/contracts/security/PullPayment.sol ^0.8.0 (*)
└── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0 (*)
src/test/OpenZeppelinNft.t.sol 0.8.10
├── lib/ds-test/src/test.sol >=0.4.23
├── lib/forge-std/src/stdlib.sol >=0.6.0 <0.9.0
│ └── lib/forge-std/src/Vm.sol >=0.6.0
test/OpenZeppelinNft.t.sol 0.8.10
├── lib/forge-std/src/Test.sol >=0.6.0 <0.9.0
│ ├── lib/forge-std/src/Script.sol >=0.6.0 <0.9.0
│ │ ├── lib/forge-std/src/Vm.sol >=0.6.0
│ │ ├── lib/forge-std/src/console.sol >=0.4.22 <0.9.0
│ │ └── lib/forge-std/src/console2.sol >=0.4.22 <0.9.0
│ └── lib/forge-std/lib/ds-test/src/test.sol >=0.5.0
├── src/OpenZeppelinNft.sol 0.8.10 (*)
├── src/test/interfaces/HEVM.sol
└── lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol ^0.8.0
src/test/SolmateNft.sol 0.8.10
├── lib/ds-test/src/test.sol >=0.4.23
├── lib/forge-std/src/stdlib.sol >=0.6.0 <0.9.0 (*)
├── src/SolmateNft.sol 0.8.10 (*)
└── src/test/interfaces/HEVM.sol
src/test/interfaces/HEVM.sol
test/SolmateNft.sol 0.8.10
├── lib/forge-std/src/Test.sol >=0.6.0 <0.9.0 (*)
└── src/SolmateNft.sol 0.8.10 (*)
// ANCHOR_END: output
// ANCHOR_END: all
45 changes: 24 additions & 21 deletions src/output/forge_tree/forge-tree-no-dedupe
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ src/SolmateNft.sol 0.8.10
│ └── lib/openzeppelin-contracts/contracts/utils/Address.sol ^0.8.1
└── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
└── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
src/test/OpenZeppelinNft.t.sol 0.8.10
├── lib/ds-test/src/test.sol >=0.4.23
├── lib/forge-std/src/stdlib.sol >=0.6.0 <0.9.0
│ └── lib/forge-std/src/Vm.sol >=0.6.0
test/OpenZeppelinNft.t.sol 0.8.10
├── lib/forge-std/src/Test.sol >=0.6.0 <0.9.0
│ ├── lib/forge-std/src/Script.sol >=0.6.0 <0.9.0
│ │ ├── lib/forge-std/src/Vm.sol >=0.6.0
│ │ ├── lib/forge-std/src/console.sol >=0.4.22 <0.9.0
│ │ └── lib/forge-std/src/console2.sol >=0.4.22 <0.9.0
│ └── lib/forge-std/lib/ds-test/src/test.sol >=0.5.0
├── src/OpenZeppelinNft.sol 0.8.10
│ ├── lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol ^0.8.0
│ │ ├── lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol ^0.8.0
Expand All @@ -59,23 +62,23 @@ src/test/OpenZeppelinNft.t.sol 0.8.10
│ │ └── lib/openzeppelin-contracts/contracts/utils/Address.sol ^0.8.1
│ └── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
│ └── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
├── src/test/interfaces/HEVM.sol
└── lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol ^0.8.0
src/test/SolmateNft.sol 0.8.10
├── lib/ds-test/src/test.sol >=0.4.23
├── lib/forge-std/src/stdlib.sol >=0.6.0 <0.9.0
│ └── lib/forge-std/src/Vm.sol >=0.6.0
├── src/SolmateNft.sol 0.8.10
│ ├── lib/solmate/src/tokens/ERC721.sol >=0.8.0
│ ├── lib/openzeppelin-contracts/contracts/utils/Strings.sol ^0.8.0
│ ├── lib/openzeppelin-contracts/contracts/security/PullPayment.sol ^0.8.0
│ │ └── lib/openzeppelin-contracts/contracts/utils/escrow/Escrow.sol ^0.8.0
│ │ ├── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
│ │ │ └── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
│ │ └── lib/openzeppelin-contracts/contracts/utils/Address.sol ^0.8.1
│ └── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
│ └── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
└── src/test/interfaces/HEVM.sol
src/test/interfaces/HEVM.sol
test/SolmateNft.sol 0.8.10
├── lib/forge-std/src/Test.sol >=0.6.0 <0.9.0
│ ├── lib/forge-std/src/Script.sol >=0.6.0 <0.9.0
│ │ ├── lib/forge-std/src/Vm.sol >=0.6.0
│ │ ├── lib/forge-std/src/console.sol >=0.4.22 <0.9.0
│ │ └── lib/forge-std/src/console2.sol >=0.4.22 <0.9.0
│ └── lib/forge-std/lib/ds-test/src/test.sol >=0.5.0
└── src/SolmateNft.sol 0.8.10
├── lib/solmate/src/tokens/ERC721.sol >=0.8.0
├── lib/openzeppelin-contracts/contracts/utils/Strings.sol ^0.8.0
├── lib/openzeppelin-contracts/contracts/security/PullPayment.sol ^0.8.0
│ └── lib/openzeppelin-contracts/contracts/utils/escrow/Escrow.sol ^0.8.0
│ ├── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
│ │ └── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
│ └── lib/openzeppelin-contracts/contracts/utils/Address.sol ^0.8.1
└── lib/openzeppelin-contracts/contracts/access/Ownable.sol ^0.8.0
└── lib/openzeppelin-contracts/contracts/utils/Context.sol ^0.8.0
// ANCHOR_END: output
// ANCHOR_END: all
5 changes: 3 additions & 2 deletions src/output/fuzz_testing/forge-test-fail-fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ $ forge test --allow-failure
// ANCHOR_END: command
// ANCHOR: output
Compiling 1 files with 0.8.10
Solc 0.8.10 finished in 1.69s
Compiler run successful

Running 1 test for test/Safe.t.sol:SafeTest
[FAIL. Counterexample: calldata=0x215a2f200000000000000000000000000000000000000001000000000000000000000000, args=[79228162514264337593543950336]] testWithdraw(uint256) (runs: 45, μ: 19554, ~: 19554)
Test result: FAILED. 0 passed; 1 failed; finished in 23.75ms
[FAIL. Reason: EvmError: Revert Counterexample: calldata=0x215a2f200000000000000000000000000000000000000001000000000000000000000000, args=[79228162514264337593543950336]] testWithdraw(uint256) (runs: 47, μ: 19554, ~: 19554)
Test result: FAILED. 0 passed; 1 failed; finished in 8.75ms
// ANCHOR_END: output
// ANCHOR_END: all
3 changes: 2 additions & 1 deletion src/output/fuzz_testing/forge-test-no-fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ $ forge test
// ANCHOR_END: command
// ANCHOR: output
Compiling 6 files with 0.8.10
Solc 0.8.10 finished in 3.78s
Compiler run successful

Running 1 test for test/Safe.t.sol:SafeTest
[PASS] testWithdraw() (gas: 19462)
Test result: ok. 1 passed; 0 failed; finished in 781.50µs
Test result: ok. 1 passed; 0 failed; finished in 873.70µs
// ANCHOR_END: output
// ANCHOR_END: all
5 changes: 3 additions & 2 deletions src/output/fuzz_testing/forge-test-success-fuzz
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ $ forge test
// ANCHOR_END: command
// ANCHOR: output
Compiling 1 files with 0.8.10
Solc 0.8.10 finished in 1.67s
Compiler run successful

Running 1 test for test/Safe.t.sol:SafeTest
[PASS] testWithdraw(uint96) (runs: 256, μ: 13268, ~: 19654)
Test result: ok. 1 passed; 0 failed; finished in 88.82ms
[PASS] testWithdraw(uint96) (runs: 256, μ: 19078, ~: 19654)
Test result: ok. 1 passed; 0 failed; finished in 19.56ms
// ANCHOR_END: output
// ANCHOR_END: all
3 changes: 2 additions & 1 deletion src/output/hello_foundry/forge-build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
$ forge build
// ANCHOR_END: command
// ANCHOR: output
Compiling 7 files with 0.8.13
Compiling 10 files with 0.8.16
Solc 0.8.16 finished in 3.97s
Compiler run successful
// ANCHOR_END: output
// ANCHOR_END: all
4 changes: 2 additions & 2 deletions src/output/hello_foundry/forge-init
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
$ forge init hello_foundry
// ANCHOR_END: command
// ANCHOR: output
Initializing /tmp/tmp.VApK8lvc65/hello_foundry...
Installing forge-std in "/tmp/tmp.VApK8lvc65/hello_foundry/lib/forge-std", (url: https://github.com/foundry-rs/forge-std, tag: None)
Initializing /private/var/folders/p_/xbvs4ns92wj3b9xmkc1zkw2w0000gn/T/tmp.yadmclfP/hello_foundry...
Installing forge-std in "/private/var/folders/p_/xbvs4ns92wj3b9xmkc1zkw2w0000gn/T/tmp.yadmclfP/hello_foundry/lib/forge-std" (url: Some("https://github.com/foundry-rs/forge-std"), tag: None)
Installed forge-std
Initialized forge project.
// ANCHOR_END: output
Expand Down
7 changes: 4 additions & 3 deletions src/output/hello_foundry/forge-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ $ forge test
// ANCHOR: output
No files changed, compilation skipped

Running 1 test for test/Contract.t.sol:ContractTest
[PASS] testExample() (gas: 279)
Test result: ok. 1 passed; 0 failed; finished in 599.09µs
Running 2 tests for test/Counter.t.sol:CounterTest
[PASS] testIncrement() (gas: 28312)
[PASS] testSetNumber(uint256) (runs: 256, μ: 27376, ~: 28387)
Test result: ok. 2 passed; 0 failed; finished in 24.43ms
// ANCHOR_END: output
// ANCHOR_END: all
11 changes: 6 additions & 5 deletions src/output/hello_foundry/tree-with-files
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ $ tree . -L 3 -I output
├── foundry.toml
├── lib
│   └── forge-std
│   ├── lib
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── foundry.toml
│   ├── lib
│   └── src
├── script
│   └── Contract.s.sol
│   └── Counter.s.sol
├── src
│   └── Contract.sol
│   └── Counter.sol
└── test
└── Contract.t.sol
└── Counter.t.sol

7 directories, 7 files
7 directories, 8 files
// ANCHOR_END: output
// ANCHOR_END: all
40 changes: 20 additions & 20 deletions src/output/nft_tutorial/forge-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ $ forge test
// ANCHOR: output
No files changed, compilation skipped

Running 8 tests for src/test/SolmateNft.sol:SolmateNftTests
[PASS] testBalanceIncremented() (gas: 218897)
[PASS] testFailMaxSupplyReached() (gas: 136426)
[PASS] testFailMintToZeroAddress() (gas: 34564)
[PASS] testFailNoMintPricePaid() (gas: 5503)
[PASS] testFailUnSafeContractReceiver() (gas: 89813)
[PASS] testMintPricePaid() (gas: 81279)
[PASS] testNewMintOwnerRegistered() (gas: 192272)
[PASS] testSafeContractReceiver() (gas: 274092)
Test result: ok. 8 passed; 0 failed; finished in 2.50ms
Running 8 tests for test/OpenZeppelinNft.t.sol:OpenZeppelinNftTests
[PASS] testBalanceIncremented() (gas: 217829)
[PASS] testFailMaxSupplyReached() (gas: 134524)
[PASS] testFailMintToZeroAddress() (gas: 34577)
[PASS] testFailNoMintPricePaid() (gas: 5568)
[PASS] testFailUnSafeContractReceiver() (gas: 88276)
[PASS] testMintPricePaid() (gas: 81554)
[PASS] testNewMintOwnerRegistered() (gas: 190956)
[PASS] testSafeContractReceiver() (gas: 273132)
Test result: ok. 8 passed; 0 failed; finished in 2.68ms

Running 8 tests for src/test/OpenZeppelinNft.t.sol:OpenZeppelinNftTests
[PASS] testBalanceIncremented() (gas: 219326)
[PASS] testFailMaxSupplyReached() (gas: 136426)
[PASS] testFailMintToZeroAddress() (gas: 34620)
[PASS] testFailNoMintPricePaid() (gas: 5503)
[PASS] testFailUnSafeContractReceiver() (gas: 90282)
[PASS] testMintPricePaid() (gas: 81512)
[PASS] testNewMintOwnerRegistered() (gas: 192487)
[PASS] testSafeContractReceiver() (gas: 274588)
Test result: ok. 8 passed; 0 failed; finished in 2.71ms
Running 8 tests for test/SolmateNft.sol:SolmateNftTests
[PASS] testBalanceIncremented() (gas: 217400)
[PASS] testFailMaxSupplyReached() (gas: 134524)
[PASS] testFailMintToZeroAddress() (gas: 34521)
[PASS] testFailNoMintPricePaid() (gas: 5568)
[PASS] testFailUnSafeContractReceiver() (gas: 87807)
[PASS] testMintPricePaid() (gas: 81321)
[PASS] testNewMintOwnerRegistered() (gas: 190741)
[PASS] testSafeContractReceiver() (gas: 272636)
Test result: ok. 8 passed; 0 failed; finished in 2.79ms
// ANCHOR_END: output
// ANCHOR_END: all
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ $ forge test --match-contract ComplicatedContractTest --match-test testDeposit
// ANCHOR_END: command
// ANCHOR: output
Compiling 7 files with 0.8.10
Solc 0.8.10 finished in 4.20s
Compiler run successful

Running 2 tests for test/ComplicatedContract.t.sol:ComplicatedContractTest
[PASS] testDepositERC20() (gas: 102237)
[PASS] testDepositETH() (gas: 61458)
Test result: ok. 2 passed; 0 failed; finished in 1.15ms
Test result: ok. 2 passed; 0 failed; finished in 1.05ms
// ANCHOR_END: output
// ANCHOR_END: all