libsml-testing icon indicating copy to clipboard operation
libsml-testing copied to clipboard

Add expected test results

Open micw opened this issue 2 years ago • 2 comments

Hello,

IMO it would make sense to add the expected results (e.g. a list of extracted obis codes, units and values) so that this can be used to create unit tests.

micw avatar Apr 01 '23 16:04 micw

I'm not sure how the expected files should look like. I'd expect the format to heavily depend on the actual implementation and how detailed it parses the data.

In sml-rs, I tried to make the parser lossless in a sense that every attribute present in the SML spec can be accessed. I'm using debug outputs of the parsed data for my expected files. I went through them once to see whether the output makes sense. I'm using them to detect regressions now.

Here's my expected files, in case you are interested: https://github.com/felixwrt/sml-rs/tree/main/tests/snapshots

felixwrt avatar Apr 01 '23 18:04 felixwrt

that's something that we can think about, but i have no ressources for this at the moment. sorry

devZer0 avatar Apr 18 '23 20:04 devZer0