Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add array and slice control flow tests (#5558)
# Description TODO - [x] Make note to finish slice test after `pop_front` issue: #5462 - [x] Refactor `any::<T>()` - [x] Make issues for failing tests ## Problem\* Part of #5362 ## Summary\* Simple combinator-based parsing tests for control flow. - Originally designed for slices, but adapted to arrays by emulating slices as bounded vectors ```rust struct Bvec<T, let N: u32> { inner: [T; N], // elements at indices < offset are zero offset: u32, // elements at indices >= len are zero len: u32, } ``` ## Additional Context This code is hacky, but let me know if any parts are worth cleaning up for the stdlib, e.g. `reverse_array`. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: jfecher <[email protected]>
- Loading branch information