Skip to content

Commit

Permalink
chore(derive): Batch Timestamp Tests (#664)
Browse files Browse the repository at this point in the history
* chore(derive): batch timestamp tests

* fix: lints
  • Loading branch information
refcell authored Oct 9, 2024
1 parent 25af581 commit 18a606a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/derive/src/batch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,20 @@ impl Batch {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_timestamp() {
let single_batch = SingleBatch { timestamp: 123, ..Default::default() };
let span_batch = SpanBatch {
batches: vec![SpanBatchElement { timestamp: 456, ..Default::default() }],
..Default::default()
};

assert_eq!(Batch::Single(single_batch).timestamp(), 123);
assert_eq!(Batch::Span(span_batch).timestamp(), 456);
}
}

0 comments on commit 18a606a

Please sign in to comment.