mlswg / mls-implementations

Coordination of implementation and interop specific details
110 stars 14 forks source link

added a deserialization test #174

Closed Aurvandill closed 9 months ago

Aurvandill commented 10 months ago

Relates to #172

This is a Test to check the deserialization of a vector containing Optional Vectors.

raphaelrobert commented 10 months ago

I'm not sure I understand the purpose of this PR.

Is your goal to check the variable length encoding and the optional encoding?

If so, there's no need to have all this random data. For the optional encoding, you can just hardcode the two cases and for VL vectors you can use something like:

[
    {
        "length": "10",
        "bytes": "..."
    },
]

where you pick a few interesting numbers for the length value and encode the bytes by repeating a value that many times.

Aurvandill commented 10 months ago

Thanks for the Input that is indeed more usefull than the random data. I will change the PR accordingly soon

raphaelrobert commented 10 months ago

You could actually just use the VL prefix, the implementations can append a byte slice of the correct length.

Aurvandill commented 9 months ago

@raphaelrobert i modified the test case and hope the description i wrote makes sense.