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

Add missing test for demangle for OSX #67

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ mod tests {
t!("_ZN4testE", "test");
t_err!("_ZN4test");
t!("_ZN4test1a2bcE", "test::a::bc");
t_err!("_RIIC0pLLpOvR_RIIC0pLLLLppOvRvR]AvR]A?");
t_err!("_RYFFFFFFFFFGFF_RC4$estEFFFFGFF_UC4$estEFFGFF_UC4$estEtesC4$estEt___d@[email protected]/Y");
}

#[test]
Expand All @@ -415,6 +417,9 @@ mod tests {
t!("_ZN8$BP$test4foobE", "*test::foob");
t!("_ZN9$u20$test4foobE", " test::foob");
t!("_ZN35Bar$LT$$u5b$u32$u3b$$u20$4$u5d$$GT$E", "Bar<[u32; 4]>");
t_err!("_ZN4ts$eEt_sd");
t_err!("_RC4$estEtesd");
t_err!("_ZN4.estEtesd");
}

#[test]
Expand Down Expand Up @@ -585,4 +590,19 @@ mod tests {
"foo.llvm moocow <mio::sys::unix::selector::epoll::Selector>::select foo.llvm"
);
}

#[test]
#[cfg(feature = "std")]
fn test_demangle_with_suffix() {
assert_eq!(
crate::demangle("RIB_RDB_IIB_RDIB_B_RDB_IIB_RDIRDB_B").suffix,
""
);
assert_eq!(
crate::demangle("RYYFK17o05YYQLF___NQQQYFFFFK17o05YYQQqLfF___NQQQYYFFF9E1o_ZB6").suffix,
""
);
assert_eq!(crate::demangle("33\nRYFKC*F").suffix, "");
assert_eq!(crate::demangle("RYFK0ZFF").suffix, "");
}
}
17 changes: 17 additions & 0 deletions src/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,7 @@ mod tests {
#[test]
fn demangle_crate_with_leading_digit() {
t_nohash!("_RNvC6_123foo3bar", "123foo::bar");
t_nohash!("__RNvC6_123foo3bar", "123foo::bar");
}

#[test]
Expand All @@ -1293,6 +1294,10 @@ mod tests {
"_RNqCs4fqI2P2rA04_11utf8_identsu30____7hkackfecea1cbdathfdh9hlq6y",
"utf8_idents::საჭმელად_გემრიელი_სადილი"
);
t_nohash!(
"__RNqCs4fqI2P2rA04_11utf8_identsu30____7hkackfecea1cbdathfdh9hlq6y",
"utf8_idents::საჭმელად_გემრიელი_სადილი"
);
}

#[test]
Expand All @@ -1305,6 +1310,14 @@ mod tests {
"_RNCINkXs25_NgCsbmNqQUJIY6D_4core5sliceINyB9_4IterhENuNgNoBb_4iter8iterator8Iterator9rpositionNCNgNpB9_6memchr7memrchrs_0E0Bb_",
"<core::slice::Iter<u8> as core::iter::iterator::Iterator>::rposition::<core::slice::memchr::memrchr::{closure#1}>::{closure#0}"
);
t_nohash!(
"__RNCNCNgCs6DXkGYLi8lr_2cc5spawn00B5_",
"cc::spawn::{closure#0}::{closure#0}"
);
t_nohash!(
"__RNCINkXs25_NgCsbmNqQUJIY6D_4core5sliceINyB9_4IterhENuNgNoBb_4iter8iterator8Iterator9rpositionNCNgNpB9_6memchr7memrchrs_0E0Bb_",
"<core::slice::Iter<u8> as core::iter::iterator::Iterator>::rposition::<core::slice::memchr::memrchr::{closure#1}>::{closure#0}"
);
}

#[test]
Expand All @@ -1313,6 +1326,10 @@ mod tests {
"_RINbNbCskIICzLVDPPb_5alloc5alloc8box_freeDINbNiB4_5boxed5FnBoxuEp6OutputuEL_ECs1iopQbuBiw2_3std",
"alloc::alloc::box_free::<dyn alloc::boxed::FnBox<(), Output = ()>>"
);
t_nohash!(
"__RINbNbCskIICzLVDPPb_5alloc5alloc8box_freeDINbNiB4_5boxed5FnBoxuEp6OutputuEL_ECs1iopQbuBiw2_3std",
"alloc::alloc::box_free::<dyn alloc::boxed::FnBox<(), Output = ()>>"
);
}

#[test]
Expand Down
Loading