You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I went down the BTT some time in the past while researching and contributing to the Sablier V2 code base and noticed that test files generated by Bulloak would have different test contract names than those of Sablier V2.
It could be helpful to devs to add tips in README.md on how to easily rename generated test contracts in VSCode with a simple regex search and replacement as follows:
Example:
A .tree file employing Sablier V2 format for the test label and filename: functionToTest.t.sol.
functionToTest.t.sol
├── Given one condition
│ └── It should never revert
└── Given another condition
└── It should succeed
Search:(\w+)tsol Replace:\u$1_Unit_Concrete_Test or \u$1_Integration_Concrete_Test
Executing the above search and replacement would rename the Bulloak generated test contract name from functionToTesttsol to FunctionToTest_Unit_Concrete_Test or FunctionToTest_Integration_Concrete_Test respectively.
The text was updated successfully, but these errors were encountered:
scorpion9979
changed the title
Add documentation for renaming test files
Add documentation for renaming test contracts
Jul 28, 2024
Hey @scorpion9979! I have a somewhat contrarian opinion that this shouldn't be in the README. The ideal solution here is to make these changes in the Sablier repo.
This effort will potentially be done in the future so that features missing in bulloak to support the Sablier repo are added + changes required to use bulloak there are made.
PS. I think that regex could be simplified to (\w+)tsol, right?
@alexfertel That sounds good. I felt this should still be documented somewhere as I occasionally had to run this particular search and replacement. Also, you're right regarding the simplified regex. I've updated the description of the issue to use the simplified version.
I went down the BTT some time in the past while researching and contributing to the Sablier V2 code base and noticed that test files generated by Bulloak would have different test contract names than those of Sablier V2.
It could be helpful to devs to add tips in README.md on how to easily rename generated test contracts in VSCode with a simple regex search and replacement as follows:
Example:
A
.tree
file employing Sablier V2 format for the test label and filename:functionToTest.t.sol
.Search:
(\w+)tsol
Replace:
\u$1_Unit_Concrete_Test
or\u$1_Integration_Concrete_Test
Executing the above search and replacement would rename the Bulloak generated test contract name from
functionToTesttsol
toFunctionToTest_Unit_Concrete_Test
orFunctionToTest_Integration_Concrete_Test
respectively.The text was updated successfully, but these errors were encountered: