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

remove some warnings in tests #1753

Merged
merged 1 commit into from
May 5, 2024
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
11 changes: 8 additions & 3 deletions src/multi/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{
character::streaming::digit1 as digit,
error::{ErrorKind, ParseError},
internal::{Err, IResult, Needed},
lib::std::ops::Range,
lib::std::str::{self, FromStr},
number::streaming::{be_u16, be_u8},
sequence::pair,
Expand Down Expand Up @@ -573,7 +572,7 @@ fn many_test() {
);

fn many_invalid(i: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
many(Range::default(), tag("a")).parse(i)
many(crate::lib::std::ops::Range::default(), tag("a")).parse(i)
}

let a = &b"a"[..];
Expand Down Expand Up @@ -728,7 +727,13 @@ fn fold_test() {
);

fn fold_invalid(i: &[u8]) -> IResult<&[u8], Vec<&[u8]>> {
fold(Range::default(), tag("a"), Vec::new, fold_into_vec).parse(i)
fold(
crate::lib::std::ops::Range::default(),
tag("a"),
Vec::new,
fold_into_vec,
)
.parse(i)
}

let a = &b"a"[..];
Expand Down
3 changes: 1 addition & 2 deletions src/number/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,12 +1410,12 @@ where
}

#[cfg(test)]
#[cfg(feature = "std")]
mod tests {
use super::*;
use crate::error::ErrorKind;
use crate::internal::Err;

#[cfg(feature = "std")]
macro_rules! assert_parse(
($left: expr, $right: expr) => {
let res: $crate::IResult<_, _, (_, ErrorKind)> = $left;
Expand All @@ -1424,7 +1424,6 @@ mod tests {
);

#[test]
#[cfg(feature = "std")]
fn float_test() {
let mut test_cases = vec![
"+3.14",
Expand Down
12 changes: 0 additions & 12 deletions src/sequence/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ fn single_element_tuples() {
);
}

#[derive(PartialEq, Eq, Debug)]
struct B {
a: u8,
b: u8,
}

#[derive(PartialEq, Eq, Debug)]
struct C {
a: u8,
b: Option<u8>,
}

/*FIXME: convert code examples to new error management
use util::{add_error_pattern, error_to_list, print_error};
Expand Down
Loading