Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed Jul 31, 2024
1 parent 34dc235 commit 1786b9c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tket2-hseries/src/extension/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl<'a> From<&'a FutureOp> for &'static str {
}

/// Concrete "tket2.futures" operations with type set.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FutureOp {
/// The `FutureOpDef` that defines this operation.
pub op: FutureOpDef,
Expand Down Expand Up @@ -281,6 +282,19 @@ pub(crate) mod test {
}
}

#[test]
fn future_op_from_def() {
let typ = Type::UNIT;

assert_eq!(
FutureOp {
op: FutureOpDef::Free,
typ: typ.clone()
},
FutureOpDef::Free.instantiate(&[typ.into()]).unwrap()
)
}

#[test]
fn circuit() {
let t_param = TypeParam::from(TypeBound::Any);
Expand Down

0 comments on commit 1786b9c

Please sign in to comment.