Skip to content

Commit

Permalink
Moving name tests to serializer where they were already
Browse files Browse the repository at this point in the history
  • Loading branch information
poplexity committed Oct 21, 2024
1 parent fa762a0 commit 1989a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
15 changes: 0 additions & 15 deletions crates/antelope/tests/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ use antelope::{
};
use antelope_client_macros::StructPacker;

#[test]
fn name() {
let zero_name = Name::from_u64(0);
let zero_name_string = zero_name.to_string();
assert_eq!(zero_name_string, "", "Name(0) should be empty string");

let you_name = Name::new_from_str("you");
let you_name_string = you_name.to_string();
assert_eq!(you_name_string, "you", "Name(0) should be empty string");

let dot_me_name = Name::new_from_str(".me");
let dot_me_name_string = dot_me_name.to_string();
assert_eq!(dot_me_name_string, ".me", "Name(0) should be empty string");
}

#[test]
fn asset() {
// TODO: Should asset support negative values?
Expand Down
10 changes: 4 additions & 6 deletions crates/antelope/tests/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ fn name() {
assert_eq!(name1, name2);
let name3 = Name::from_u64(6712742083569909760);
assert_eq!(name1, name3);
// TODO: The typescript lib produces empty string, are they the same? (. vs
// '')
assert_eq!(Name::from_u64(0).to_string(), ".");
/*
assert.equal(JSON.stringify(Name.from(UInt64.from(0))), """");
*/
assert_eq!(Name::from_u64(0).to_string(), "");
assert_eq!(name!(".me").to_string(), ".me");
assert_eq!(name!("you").to_string(), "you");
assert_eq!(name!("you.me").to_string(), "you.me");
}
/*
Expand Down

0 comments on commit 1989a54

Please sign in to comment.