h-m-m
h-m-m copied to clipboard
Unit testing sketch
First of all, please feel free to reject this PR if you don't like it; this is just an idea / playing around to understand the internals.
Since function definitions and calls (program execution) are all in one file, it could not be included in another script. I don't want to break the simplicity of "all in one file", hence the proposed const to conditionally disable execution.
- Added namespace to avoid potential naming conflicts, it should be "free" since the code requires php >=7.3 anyway.
- Composer config is purely for dev autoloading & tests.
- Added "learning test" to reason about the code, "mput" was simply the easiest function to tackle :sweat_smile:
@Wojciechem I liked your attitude. The fact that this project is just a file does not detract from its usefulness. Many developers just like to badmouth other people's programs instead of trying to understand why it was made that way.
@nadrad please let me know what you think when you take a look at it 😉
Thanks a lot, @Wojciechem I've never done something like this and don't understand it right away. So, give me some time to learn how these things work and then get back to it :)
Thanks again, @Wojciechem for the PR.
I spent some time on this idea, but it seems to me that having a proper understanding of how automated tests can work here needs more time, and I'm not completely happy with php to make such an investment. I'm thinking about learning a new programming language and rebuilding h-m-m in it instead. So, I think it's best to leave automated tests in php out for now. Sorry :)
It's ok :) If you ever decide to give php another chance, feel free to ping me ;)