Should I be testing this?

I mean, you can test if you want to; however, I would use rusts built in testing functionality. Mark the test with the #[test] macro. Then just import the actual create you're going to use and then assert test the expected result to the actual result. Testing a stimulated result isn't satisfactory imo. You're testing the result to how you think the software will work. Which has room for bias.

Testing in rust has standard naming conventions, this is due to the way cargo testing works. You can filter tests by name. I don't be giving a full lesson here, and I'm on mobile, so I'm gonna type for brevity; however, I would recommend looking into rust testing as it is quite I'm depth.

I'm just kinda confused on why you're doing it this way, if you're using an external create, why not just use it from the start? You're going to have to rewrite your code?

/r/learnprogramming Thread