Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #33

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -ex

FEATURES="std alloc core2"
MSRV="1\.48\.0"

cargo --version
rustc --version
Expand All @@ -13,6 +14,11 @@ if cargo --version | grep nightly >/dev/null; then
NIGHTLY=true
fi

if cargo --version | grep ${MSRV}; then
# memchr 2.6.0 uses edition 2021
cargo update -p memchr --precise 2.5.0
fi

# Make all cargo invocations verbose
export CARGO_TERM_VERBOSE=true

Expand Down
16 changes: 8 additions & 8 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,39 +207,39 @@ mod tests {
#[test]
fn decode_iter_forward() {
let hex = "deadbeef";
let v = vec![0xde, 0xad, 0xbe, 0xef];
let bytes = [0xde, 0xad, 0xbe, 0xef];

for (i, b) in HexToBytesIter::new(hex).unwrap().enumerate() {
assert_eq!(b.unwrap(), v[i]);
assert_eq!(b.unwrap(), bytes[i]);
}
}

#[test]
fn decode_iter_backward() {
let hex = "deadbeef";
let v = vec![0xef, 0xbe, 0xad, 0xde];
let bytes = [0xef, 0xbe, 0xad, 0xde];

for (i, b) in HexToBytesIter::new(hex).unwrap().rev().enumerate() {
assert_eq!(b.unwrap(), v[i]);
assert_eq!(b.unwrap(), bytes[i]);
}
}

#[test]
fn encode_iter() {
let v = vec![0xde, 0xad, 0xbe, 0xef];
let bytes = [0xde, 0xad, 0xbe, 0xef];
let hex = "deadbeef";

for (i, c) in BytesToHexIter::new(v.iter().cloned()).enumerate() {
for (i, c) in BytesToHexIter::new(bytes.iter().cloned()).enumerate() {
assert_eq!(c, hex.chars().nth(i).unwrap());
}
}

#[test]
fn encode_iter_backwards() {
let v = vec![0xde, 0xad, 0xbe, 0xef];
let bytes = [0xde, 0xad, 0xbe, 0xef];
let hex = "efbeadde";

for (i, c) in BytesToHexIter::new(v.iter().cloned()).rev().enumerate() {
for (i, c) in BytesToHexIter::new(bytes.iter().cloned()).rev().enumerate() {
assert_eq!(c, hex.chars().nth(i).unwrap());
}
}
Expand Down
Loading