aphorisme / aphorisme/packs-rs

Enhance testing

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement std_structs
主要语言
Rust
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

Enhance the testing with property based testing for pack -> unpack scenarios on primitive types, `Value` as well as standard structs (maybe use a macro?). Dependency should be part of `dev-dependencies`. To be decided if these tests are part of the integration test suite. This gives *inner consistency*. Maybe there is more to check with properties?
There are different routes for the standard structs:

- `encode` then `decode` and check that this does not fail and gives the original value
- `encode` and `StdStruct::Foo(foo).encode` which needs to lead to the same bytes
- `Foo::decode` needs to lead to the original value. As well as `StdStruct::decode`.

This applies for primitive types and their `Value` counterpart as well.

Also, enhance the testing to check for the right implementation, i.e. take a few examples and check if they get encoded into the right bytes.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。