Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
36
third-party/vendor/eyre/tests/test_repr.rs
vendored
Normal file
36
third-party/vendor/eyre/tests/test_repr.rs
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
mod common;
|
||||
mod drop;
|
||||
|
||||
use self::common::maybe_install_handler;
|
||||
use self::drop::{DetectDrop, Flag};
|
||||
use eyre::Report;
|
||||
use std::marker::Unpin;
|
||||
use std::mem;
|
||||
|
||||
#[test]
|
||||
fn test_error_size() {
|
||||
assert_eq!(mem::size_of::<Report>(), mem::size_of::<usize>());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_null_pointer_optimization() {
|
||||
assert_eq!(
|
||||
mem::size_of::<Result<(), Report>>(),
|
||||
mem::size_of::<usize>()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_autotraits() {
|
||||
fn assert<E: Unpin + Send + Sync + 'static>() {}
|
||||
assert::<Report>();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_drop() {
|
||||
maybe_install_handler().unwrap();
|
||||
|
||||
let has_dropped = Flag::new();
|
||||
drop(Report::new(DetectDrop::new("TestDrop", &has_dropped)));
|
||||
assert!(has_dropped.get());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue