Skip to content

Commit

Permalink
Update dependencies. Version bump.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffClements committed Oct 1, 2024
1 parent b9a4b18 commit 1cbb79f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "framous"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
authors = ['Geoff Clements <ro2kz0@gmail.com>']
description = "A library sending and receiving packets to and from a Reader/Writer"
Expand All @@ -13,7 +13,7 @@ categories = ["encoding", "network-programming"]
keywords = ["networking", "protocol", "framing", "bytes", "packets"]

[dependencies]
bytes = "1.6.0"
bytes = "1.7.2"

[dev-dependencies]
socket-server-mocker = "0.0.4"
socket-server-mocker = "0.2.0"
16 changes: 6 additions & 10 deletions src/framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ where
mod tests {
use bytes::{Buf, BufMut};
use socket_server_mocker::{
server_mocker::ServerMocker,
server_mocker_instruction::{ServerMockerInstruction, ServerMockerInstructionsList},
server_mocker::ServerMocker, server_mocker_instruction::Instruction::*,
tcp_server_mocker::TcpServerMocker,
};

Expand Down Expand Up @@ -289,20 +288,17 @@ mod tests {
fn framed_over_tcp() {
let test_buf = vec![2u8, 25, 143];

let tcp_server_mocker = TcpServerMocker::new(35642).unwrap();
let tcp_server_mocker = TcpServerMocker::new_with_port(35642).unwrap();
let rx = TcpStream::connect("127.0.0.1:35642").unwrap();
let tx = rx.try_clone().unwrap();

let mut framed = Framed::new(rx, tx, TestCodec, TestCodec);

tcp_server_mocker
.add_mock_instructions_list(ServerMockerInstructionsList::new_with_instructions(
[
ServerMockerInstruction::ReceiveMessage,
ServerMockerInstruction::SendMessage(Vec::from(test_buf.clone())),
]
.as_slice(),
))
.add_mock_instructions(vec![
ReceiveMessage,
SendMessage(Vec::from(test_buf.clone())),
])
.unwrap();

framed.framed_write(TestMsg::U16(6543)).ok();
Expand Down

0 comments on commit 1cbb79f

Please sign in to comment.