alexfertel / bulloak

A Solidity test generator based on the Branching Tree Technique.
Apache License 2.0
225 stars 13 forks source link

Panic when using proper English intepunction #52

Closed matmilbury closed 5 months ago

matmilbury commented 5 months ago

Given an example:

Foo
└── It can’t do X.

bulloak scaffold panics.

Notice, is used instead of '.

alexfertel commented 5 months ago

Should be fixed on https://github.com/alexfertel/bulloak/commit/3d1202adbfab6ce7e8e415e438320a23a0570a7a

I'll publish v0.6.2 in a bit so that it includes this fix

alexfertel commented 5 months ago

Published 🎉 !

Lmk if you find any issues. Closing this now.

matmilbury commented 5 months ago

wow thank you @alexfertel, I’m impressed with how well you maintain bulloak

matmilbury commented 5 months ago

I just looked at the fix implementation.

If I understand correctly, currently the bulloak uses a blacklist approach, replacing all characters that should not appear in the function name.

Have you thought about using a whitelist approach instead? Stripping all characters except allowed? For solidity function name that would be something along the lines of [a-zA-Z0-9_-]

alexfertel commented 5 months ago

I’m impressed with how well you maintain bulloak

Thank you! ❤️

Have you thought about using a whitelist approach instead?

Yes, the problem is that the change is a bit more involved because I'm not sanitizing exactly where I need to, so for example, [a-zA-Z0-9_-] would strip spaces, which breaks a few things.

I need to make some time and refactor this into a proper solution. Thanks for the suggestion, and actually, if you want to do a follow-up PR, let me know.

matmilbury commented 5 months ago

Yeah, I agree that approach will require more resources. I see an opportunity for nice fuzzy tests with this.