# Good practices for numerical array constants in tests

**URL:** <https://discourse.julialang.org/t/good-practices-for-numerical-array-constants-in-tests/127443>\
**Category:** General Usage\
**Tags:** question, testing\
**Created:** [March 28, 2025, 10:03am UTC](https://discourse.julialang.org/t/good-practices-for-numerical-array-constants-in-tests/127443 "2025-03-28T10:03:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 28, 2025, 11:12am UTC](https://discourse.julialang.org/t/good-practices-for-numerical-array-constants-in-tests/127443/4 "2025-03-28T11:12:06Z")

</div>

That gives me an idea… I realized I could just base64 encode the serialized format and have it locally in the code.

> [@Way to "encode" an object?](https://discourse.julialang.org/t/way-to-encode-an-object/26465/4):
>
> If you want a string output, just combine the previously mentioned serialization with base64 encoding. julia\> using Serialization, Base64 julia\> test = base64encode(serialize, (a="Hello World",b=2)) "N0pMBwQAAAA0EAEKTmFtZWRUdXBsZR9OAQRNYWlum0QCAAAAFAJmZxBTH04BBE1haW6bRAIAAAAAIQAIIQtIZWxsbyBXb3JsZOE=" julia\> deserialize(IOBuffer(base64decode(test))) (a = "Hello World", b = 2) Just be aware that the serialization format isn’t designed for long-term storage (i.e, it might change in the future, …

---

_[View the full topic](https://discourse.julialang.org/t/good-practices-for-numerical-array-constants-in-tests/127443)._
