Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Dec 4, 2023
1 parent dabf173 commit e227be8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@ use std::marker::PhantomData;

use derive_where::derive_where;

use self::util::AssertClone;
use self::util::{AssertClone, AssertCopy};

#[test]
fn bound() {
#[derive_where(Clone, Copy; T)]
struct Test<T, U>(T, std::marker::PhantomData<U>);

let test_1 = Test(42, PhantomData::<()>);

let _ = AssertClone(&test_1);
let _ = AssertCopy(&test_1);

#[allow(clippy::clone_on_copy)]
let test_clone = test_1.clone();
assert_eq!(test_clone.0, 42);
}

#[test]
fn custom_generic() {
Expand Down

0 comments on commit e227be8

Please sign in to comment.