Skip to content

Commit

Permalink
improve the output of runCmd
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed May 22, 2024
1 parent 440d231 commit c93911e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/CertificateTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ contract CertificateTest is BasicTest {
}

function runCmd(string[] memory cmd) internal {
// NOTE: vm.tryFfi will be supported after forge-std v1.6.1
// Vm.FfiResult memory f = vm.tryFfi(cmd);
// string memory cmdStr;
// for (uint256 i = 0; i < cmd.length; i++) {
// cmdStr = string(abi.encodePacked(cmdStr, cmd[i], " "));
// }
// require(f.exit_code == 0, cmdStr);
vm.ffi(cmd);
Vm.FfiResult memory f = vm.tryFfi(cmd);
string memory cmdStr;
for (uint256 i = 0; i < cmd.length; i++) {
cmdStr = string(abi.encodePacked(cmdStr, cmd[i], " "));
}
require(f.exitCode == 0, string(abi.encodePacked("Failed to run command: ", cmdStr)));
}
}

0 comments on commit c93911e

Please sign in to comment.