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

Add documentation for renaming test contracts #83

Open
scorpion9979 opened this issue Jul 28, 2024 · 2 comments
Open

Add documentation for renaming test contracts #83

scorpion9979 opened this issue Jul 28, 2024 · 2 comments

Comments

@scorpion9979
Copy link

scorpion9979 commented Jul 28, 2024

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.

@scorpion9979 scorpion9979 changed the title Add documentation for renaming test files Add documentation for renaming test contracts Jul 28, 2024
@alexfertel
Copy link
Owner

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?

@scorpion9979
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants