From d9e87dc647b557a2a938647c88b819fdba3f2644 Mon Sep 17 00:00:00 2001 From: Burak Bilge Yalcinkaya Date: Wed, 18 Dec 2024 14:21:04 +0300 Subject: [PATCH] add more comments for `test_cmp_bytes` --- .../data/soroban/contracts/test_compare/src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tests/integration/data/soroban/contracts/test_compare/src/lib.rs b/src/tests/integration/data/soroban/contracts/test_compare/src/lib.rs index df33a76..5f2dfba 100644 --- a/src/tests/integration/data/soroban/contracts/test_compare/src/lib.rs +++ b/src/tests/integration/data/soroban/contracts/test_compare/src/lib.rs @@ -72,7 +72,16 @@ impl CompareContract { } /// Checks whether the comparison of two `Bytes` values produces the - /// same result as comparing their corresponding slices after copying + /// same result as comparing their corresponding slices after copying. + /// + /// In the Soroban host environment, `Bytes` host objects are compared + /// by their underlying slices. + /// + /// https://github.com/stellar/rs-soroban-env/blob/c1b238b65bfd13666be4ac14e0e390c31b549caf/soroban-env-host/src/host/comparison.rs#L63 + /// + /// This test verifies that the behavior of + /// `obj_cmp` for Bytes matches the behavior of comparing the byte slices + /// created from `Bytes` objects. pub fn test_cmp_bytes(_env: Env, a: Bytes, b: Bytes) -> bool { // Initialize fixed-length arrays for storing byte data of `a` and `b`. let mut arr_a = [0 as u8; ARR_LENGTH];