Skip to content

Commit

Permalink
Using common sample for testing
Browse files Browse the repository at this point in the history
Avoid repetition.
  • Loading branch information
castelao committed Oct 14, 2023
1 parent eb5a1d1 commit fad856d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 38 deletions.
14 changes: 1 addition & 13 deletions crates/storage/src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,7 @@ impl FileSystemStorage {
#[cfg(test)]
mod test_filesystem {
use super::*;
use directip;

fn sample() -> directip::Message {
let msg = directip::mt::MTMessage::from_reader(
[
0x01, 0x00, 0x1c, 0x44, 0x00, 0x19, 0x00, 0x00, 0x27, 0x0f, 0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf5,
]
.as_slice(),
);
directip::Message::MT(msg.unwrap())
}
use directip::sample;

#[tokio::test]
async fn filesystem() {
Expand Down
14 changes: 1 addition & 13 deletions crates/storage/src/inmemory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,7 @@ impl VolatileStorage {
#[cfg(test)]
mod test_volatile {
use super::VolatileStorage;
use directip;

fn sample() -> directip::Message {
let msg = directip::mt::MTMessage::from_reader(
[
0x01, 0x00, 0x1c, 0x44, 0x00, 0x19, 0x00, 0x00, 0x27, 0x0f, 0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf5,
]
.as_slice(),
);
directip::Message::MT(msg.unwrap())
}
use directip::sample;

#[tokio::test]
async fn volatile() {
Expand Down
13 changes: 1 addition & 12 deletions crates/storage/src/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,7 @@ impl SQLiteStorage {
#[cfg(test)]
mod test_sqlite {
use super::*;

fn sample() -> directip::Message {
let msg = directip::mt::MTMessage::from_reader(
[
0x01, 0x00, 0x1c, 0x44, 0x00, 0x19, 0x00, 0x00, 0x27, 0x0f, 0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf5,
]
.as_slice(),
);
directip::Message::MT(msg.unwrap())
}
use directip::sample;

#[tokio::test]
async fn sqlite_inmemory() {
Expand Down

0 comments on commit fad856d

Please sign in to comment.