Skip to content

Commit

Permalink
Add test for box_pool with CamelCase types
Browse files Browse the repository at this point in the history
  • Loading branch information
newAM committed Nov 17, 2023
1 parent 4a811ae commit 5c8046e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Fixed clippy lints.
- Fixed `box_pool!` emitting clippy lints for `CamelCase` types.

## [v0.8.0] - 2023-11-07

Expand Down
7 changes: 7 additions & 0 deletions src/pool/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ macro_rules! box_pool {
type Data = $data_type;

fn singleton() -> &'static $crate::pool::boxed::BoxPoolImpl<$data_type> {
#[allow(non_upper_case_globals)]
static $name: $crate::pool::boxed::BoxPoolImpl<$data_type> =
$crate::pool::boxed::BoxPoolImpl::new();

Expand Down Expand Up @@ -554,4 +555,10 @@ mod tests {
assert!(once.is_ok());
assert!(twice.is_ok());
}

#[test]
fn box_pool_case() {
// https://github.com/rust-embedded/heapless/issues/411
box_pool!(CamelCaseType: u128);
}
}

0 comments on commit 5c8046e

Please sign in to comment.