Skip to content

Commit

Permalink
Restore README
Browse files Browse the repository at this point in the history
  • Loading branch information
ppamorim committed Feb 6, 2022
1 parent 036c55a commit 2963a64
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions compatibility/README.md
Expand Up @@ -9,19 +9,19 @@ We have created a test project that can be used to test the compatibility betwee
## Adding a test case for your project

To add a test case for your project, please follow the following steps:
- [X] Fork https://github.com/bincode-org/bincode
- [X] create a new file `compatibility/src/<name>.rs`.
- [X] Add a link to your project: https://github.com/ppamorim/openraft/tree/bincode-bug/example-raft-kv
- [X] Add `Licence: MIT OR Apache-2.0` if you agree to distribute your code under this license
- [X] Add a `mod <name>;` in the `lib.rs`. Make sure it's alphabetically ordered (check the ordering in your file system).
- [X] Add your structs.
- [ ] Fork https://github.com/bincode-org/bincode
- [ ] create a new file `compatibility/src/<name>.rs`.
- [ ] Add a link to your project
- [ ] Add `Licence: MIT OR Apache-2.0` if you agree to distribute your code under this license
- [ ] Add a `mod <name>;` in the `lib.rs`. Make sure it's alphabetically ordered (check the ordering in your file system).
- [ ] Add your structs.
- Adding references to libraries is not recommended. Libraries will not be implementing `bincode 2`'s encoding/decoding system.
- If you need references to libraries, consider adding a test case for that library, and then referencing that test.
- [X] Make sure structs derive the following traits:
- [X] `serde::Serialize` and `serde::Deserialize`, like normal
- [X] `bincode_2::Encode` and `bincode_2::Decode`, for the bincode 2 encode/decode mechanic
- [X] Because the crate is renamed to `bincode_2`, you also need to add `#[bincode(crate = "bincode_2")]`
- [X] `Debug, PartialEq`
- [ ] Make sure structs derive the following traits:
- [ ] `serde::Serialize` and `serde::Deserialize`, like normal
- [ ] `bincode_2::Encode` and `bincode_2::Decode`, for the bincode 2 encode/decode mechanic
- [ ] Because the crate is renamed to `bincode_2`, you also need to add `#[bincode(crate = "bincode_2")]`
- [ ] `Debug, PartialEq`

```rs
#[derive(Serialize, Deserialize, bincode_2::Encode, bincode_2::Decode, Debug, PartialEq)]
Expand All @@ -30,9 +30,9 @@ pub struct YourStruct {
}
```

- [X] Use `rand` to be able to generate a random test case for your project.
- [X] For strings there is a helper function in `crate`: `gen_string(rng: &mut impl Rng) -> String`
- [X] Add the following code:
- [ ] Use `rand` to be able to generate a random test case for your project.
- [ ] For strings there is a helper function in `crate`: `gen_string(rng: &mut impl Rng) -> String`
- [ ] Add the following code:

```rs
#[test]
Expand All @@ -46,4 +46,4 @@ pub fn test() {

For examples, see the existing cases in `compatibility/src/`.

- [ ] Open a [pull request](https://github.com/bincode-org/bincode/pulls) with the title `Bincode 1 compatiblity: <name of your project>`
- [ ] Open a [pull request](https://github.com/bincode-org/bincode/pulls) with the title `Bincode 1 compatiblity: <name of your project>`

0 comments on commit 2963a64

Please sign in to comment.