From 1e3089e10a6045b4a501c07582de5c8f2b5367cd Mon Sep 17 00:00:00 2001 From: Hokeun Kim Date: Fri, 26 Jan 2024 13:25:27 -0700 Subject: [PATCH] Add first unit test --- rust/rti/src/tag.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rust/rti/src/tag.rs b/rust/rti/src/tag.rs index 35440ae..be08273 100644 --- a/rust/rti/src/tag.rs +++ b/rust/rti/src/tag.rs @@ -173,7 +173,7 @@ impl Tag { // ); result } - + pub fn lf_tag_add(a: &Tag, b: &Tag) -> Tag { if a.time() == NEVER || b.time() == NEVER { return Tag::never_tag(); @@ -194,3 +194,15 @@ impl Tag { result } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_lf_tag_compare() { + let t1 = Tag::new(0, 0); + let t2 = Tag::new(0, 0); + assert_eq!(0, Tag::lf_tag_compare(&t1, &t2)) + } +} \ No newline at end of file