h-m-m icon indicating copy to clipboard operation
h-m-m copied to clipboard

Unit testing sketch

Open Wojciechem opened this issue 2 years ago • 3 comments

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 avatar Sep 14 '22 22:09 Wojciechem

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

llagerlof avatar Sep 15 '22 12:09 llagerlof

@nadrad please let me know what you think when you take a look at it 😉

Wojciechem avatar Sep 15 '22 16:09 Wojciechem

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 :)

nadrad avatar Sep 15 '22 18:09 nadrad

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 :)

nadrad avatar May 12 '23 03:05 nadrad

It's ok :) If you ever decide to give php another chance, feel free to ping me ;)

Wojciechem avatar May 14 '23 17:05 Wojciechem