-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compile test for odd capacity BufEncoder
Add two compile test crates that are identical except for the capacity of `BufEncoder`. Odd capacity in `fail/` that must not compile and even capacity in `pass/` that must compile.
- Loading branch information
1 parent
c7eb39e
commit 82918e6
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "odd-capacity" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.63.0" | ||
|
||
[workspace] | ||
|
||
[dependencies] | ||
hex = { package = "hex-conservative", path = "../../../../" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use hex::buf_encoder::BufEncoder; | ||
use hex::Case; | ||
|
||
// This should fail to compile because the capacity size is odd. | ||
// The only difference to `even-capacity` is the capacity size. | ||
fn main() { let _encoder = BufEncoder::<3>::new(Case::Lower); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "even-capacity" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.63.0" | ||
|
||
[workspace] | ||
|
||
[dependencies] | ||
hex = { package = "hex-conservative", path = "../../../../" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use hex::buf_encoder::BufEncoder; | ||
use hex::Case; | ||
|
||
// This should compile, ensuring that the compile error in odd-capacity is from the odd capacity. | ||
fn main() { let _encoder = BufEncoder::<4>::new(Case::Lower); } |