lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> a, b, c, d = lib.unpack(">lBxxH", lib.pack(">lBxxH", -20, 10, 250))
> assert(a == -20 and b == 10 and c == 250 and d == 10)
> ```
> 
> So, I changed the assert to:
> 
> `assert(a == -20 and b == 10 and c == 250 and d == lib.size(">lBxxH") + 1)`
> 
> [...]
> 
> 1: Am I correct that struct doesn't seem to be broken and that the
> test is to blame, in this case?

Yes.


> 2: Is my edit to the test sane, not amounting to checking an error
> with something that might actually be buggy code?

Yes, it is sane.

-- Roberto