Open ericonr opened 4 years ago
I like this idea, but I'd like to see it come with test cases to validate behavior before and after. Ideally you'd do it as:
As you mentioned, raw ints are error proned, so care should be taken to not make the problem any worse than it already is.
Fair enough. It seems XBPS has mainly integration tests instead of unit tests, so I will have to think about how to build them.
So, following @Duncaen suggestions, I'm taking a look at the code for xbps-query, to start off.
I noticed that a few portions of the code, for example xbps-query's
main.c
, are using raw ints instead of enums for some things. I feel like changing some of those to enums would make the code clearer and the process of messing with it less error prone. So, while possibly adding new features, I could also change some of those raw ints to enums.Would there be any issue with this?