mirror of
https://github.com/logos-messaging/chat_proto.git
synced 2026-01-02 21:13:09 +00:00
14 lines
408 B
Nim
14 lines
408 B
Nim
import unittest
|
|
|
|
import chat_proto
|
|
|
|
suite "Type Encoding Tests":
|
|
test "HistoryEntry roundtrip":
|
|
let x = chat_proto.HistoryEntry(message_id: "12345", retrieval_hint: @[1'u8, 2, 3, 255])
|
|
let encoded = Protobuf.encode(x)
|
|
let decoded = Protobuf.decode(encoded, HistoryEntry)
|
|
|
|
check x.message_id == decoded.message_id
|
|
check x.retrieval_hint == decoded.retrieval_hint
|
|
check x == decoded
|