From 8cd4eb7f54d9d5b616bea0e92060d843c7898558 Mon Sep 17 00:00:00 2001 From: Peter Bwire Date: Tue, 14 May 2024 10:51:00 +0300 Subject: [PATCH] add test for memory saving optimization --- test/xid_test.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/xid_test.dart b/test/xid_test.dart index b46409a..1467571 100644 --- a/test/xid_test.dart +++ b/test/xid_test.dart @@ -75,6 +75,21 @@ void main() { true, ); }); + + final xidStructure = Xid(); + test('Binary data length test', () { + // Sample binary data + List binaryData = xidStructure.toBytes(); + + // Convert binary data to string + String binaryString = xidStructure.toString(); + + // Check if binary data is 12 bytes in length + expect(binaryData.length, 12); + + // Check if string representation of binary data is 20 characters in length + expect(binaryString.length, 20); + }); }); }