From 9d2dfc1fe88a21c94d5eb90d98e688e92751890e Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Tue, 22 Aug 2023 13:19:04 +0200 Subject: [PATCH] Test for var equality --- src/variable.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/variable.rs b/src/variable.rs index d5b0c8a..a8ee29e 100644 --- a/src/variable.rs +++ b/src/variable.rs @@ -169,6 +169,14 @@ mod tests { assert!(!var.borrow().inner().is_null()); } + #[test] + fn var_eq() { + let mut model = Model::new().include_default_plugins().create_prob("test"); + let var1 = model.add_var(0.0, 1.0, 2.0, "x", VarType::Integer); + let var2 = model.add_var(0.0, 1.0, 2.0, "x", VarType::Integer); + assert_ne!(var1, var2); + } + #[test] fn attach_data() { let mut model = Model::new().include_default_plugins().create_prob("test");