Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lisicky committed Sep 10, 2024
1 parent f0e7093 commit 85398ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rust/src/tests/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,4 +851,19 @@ fn plutus_map_keys_duplication_test() {
assert_eq!(map_from_bytes.total_len(), 3);

assert_eq!(map, map_from_bytes)
}

#[test]
fn too_big_plutus_int_to_json() {
let too_big_int = BigInt::from_str("999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999").unwrap();
let plutus_data = PlutusData::new_integer(&too_big_int);
let json = plutus_data.to_json(PlutusDatumSchema::DetailedSchema);
#[cfg(feature = "arbitrary-precision-json")]
{
assert!(json.is_ok());
}
#[cfg(not(feature = "arbitrary-precision-json"))]
{
assert!(json.is_err());
}
}

0 comments on commit 85398ed

Please sign in to comment.