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

Adapt to removal of ConversionError from number type conversions. #1083

Merged
merged 4 commits into from
Sep 9, 2023
Merged
Changes from 1 commit
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
28 changes: 14 additions & 14 deletions soroban-sdk/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ mod test {
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_vec_iter_panic_on_conversion() {
let env = Env::default();

Expand Down Expand Up @@ -1269,7 +1269,7 @@ mod test {

let mut iter = vec.try_iter();
assert_eq!(iter.next(), Some(Ok(1)));
assert_eq!(iter.next(), Some(Err(ConversionError)));
assert_eq!(iter.next(), Some(Err(ConversionError.into())));
}

#[test]
Expand Down Expand Up @@ -1409,7 +1409,7 @@ mod test {
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_pop_front_panics_on_conversion() {
let env = Env::default();

Expand All @@ -1427,11 +1427,11 @@ mod test {
let mut v: Vec<i64> = v.try_into_val(&env).unwrap();

assert_eq!(v.try_pop_front(), Ok(Some(1)));
assert_eq!(v.try_pop_front(), Err(ConversionError));
assert_eq!(v.try_pop_front(), Err(ConversionError.into()));
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_pop_front_unchecked_panics_on_conversion() {
let env = Env::default();

Expand Down Expand Up @@ -1459,7 +1459,7 @@ mod test {
let mut v: Vec<i64> = v.try_into_val(&env).unwrap();

assert_eq!(v.try_pop_front_unchecked(), Ok(1));
assert_eq!(v.try_pop_front_unchecked(), Err(ConversionError));
assert_eq!(v.try_pop_front_unchecked(), Err(ConversionError.into()));
}

#[test]
Expand Down Expand Up @@ -1506,7 +1506,7 @@ mod test {
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_pop_back_panics_on_conversion() {
let env = Env::default();

Expand All @@ -1524,11 +1524,11 @@ mod test {
let mut v: Vec<i64> = v.try_into_val(&env).unwrap();

assert_eq!(v.try_pop_back(), Ok(Some(2)));
assert_eq!(v.try_pop_back(), Err(ConversionError));
assert_eq!(v.try_pop_back(), Err(ConversionError.into()));
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_pop_back_unchecked_panics_on_conversion() {
let env = Env::default();

Expand Down Expand Up @@ -1556,7 +1556,7 @@ mod test {
let mut v: Vec<i64> = v.try_into_val(&env).unwrap();

assert_eq!(v.try_pop_back_unchecked(), Ok(2));
assert_eq!(v.try_pop_back_unchecked(), Err(ConversionError));
assert_eq!(v.try_pop_back_unchecked(), Err(ConversionError.into()));
}

#[test]
Expand Down Expand Up @@ -1596,7 +1596,7 @@ mod test {
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_get_panics_on_conversion() {
let env = Env::default();

Expand Down Expand Up @@ -1636,7 +1636,7 @@ mod test {
let v: Val = (1i64, 2i32).try_into_val(&env).unwrap();
let v: Vec<i64> = v.try_into_val(&env).unwrap();
assert_eq!(v.try_get(0), Ok(Some(1)));
assert_eq!(v.try_get(1), Err(ConversionError));
assert_eq!(v.try_get(1), Err(ConversionError.into()));
}

#[test]
Expand All @@ -1655,7 +1655,7 @@ mod test {
}

#[test]
#[should_panic(expected = "ConversionError")]
#[should_panic(expected = "Error(Value, UnexpectedType)")]
fn test_get_unchecked_panics_on_conversion() {
let env = Env::default();

Expand Down Expand Up @@ -1693,7 +1693,7 @@ mod test {
let v: Val = (1i64, 2i32).try_into_val(&env).unwrap();
let v: Vec<i64> = v.try_into_val(&env).unwrap();
assert_eq!(v.try_get_unchecked(0), Ok(1));
assert_eq!(v.try_get_unchecked(1), Err(ConversionError));
assert_eq!(v.try_get_unchecked(1), Err(ConversionError.into()));
}

#[test]
Expand Down