test: decode pong response

This commit is contained in:
meowkatee
2025-11-30 21:16:06 +08:00
parent 77cdf7801d
commit 8d2c3ab82c
2 changed files with 12 additions and 1 deletions

View File

@@ -81,6 +81,16 @@ mod _tests {
use crate::title::{Sdgb1_50, encryption::*};
#[test]
fn test_ping_dec() -> Result<(), ApiError> {
let mut data = b"\x72\x5c\xa5\x55\x27\x14\x85\xd1\x64\xc8\x64\x5b\x6e\x5f\xd8\xe3\
\x3f\x36\x4c\x9a\x3b\xa5\xb0\x9e\x75\xae\x83\xee\xb3\xb9\x2a\x75"
.to_vec();
let decoded = Sdgb1_50::decode(&mut data)?;
assert_eq!(decoded, b"{\"result\":\"Pong\"}");
Ok(())
}
#[test]
fn test_sdgb_150_dec_enc() -> Result<(), ApiError> {
let data = [
@@ -106,7 +116,6 @@ mod _tests {
Ok(())
}
// FIXME: user data decryption
#[test]
fn test_user_data_dec() -> Result<(), ApiError> {
let data = [

View File

@@ -59,6 +59,8 @@ pub trait MaiVersionExt: MaiVersion {
.with_header(CONTENT_ENCODING, "deflate")
.with_header(EXPECT, "100-continue");
debug!("request: {req:?}");
Ok(req)
}