aboutsummaryrefslogtreecommitdiff
path: root/src/status.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/status.rs')
-rw-r--r--src/status.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/status.rs b/src/status.rs
index b8f9029..7d254aa 100644
--- a/src/status.rs
+++ b/src/status.rs
@@ -3,6 +3,7 @@ use crate::{SerializeResult, SerializeErr, Serialize as McSerialize, Deserialize
use crate::uuid::UUID4;
use serde::{Serialize, Serializer, Deserialize, Deserializer};
use std::fmt;
+use crate::protocol::TestRandom;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct StatusSpec {
@@ -31,6 +32,26 @@ impl McDeserialize for StatusSpec {
}
}
+
+#[cfg(test)]
+impl TestRandom for StatusSpec {
+ fn test_gen_random() -> Self {
+ Self {
+ version: StatusVersionSpec{
+ protocol: rand::random(),
+ name: String::test_gen_random(),
+ },
+ players: StatusPlayersSpec{
+ sample: Vec::default(),
+ max: rand::random(),
+ online: rand::random(),
+ },
+ favicon: None,
+ description: Chat::test_gen_random(),
+ }
+ }
+}
+
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct StatusVersionSpec {
pub name: String,