diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-11-22 15:44:19 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-11-22 15:44:19 +0100 |
| commit | 1fb95dade2273b9c4748c74288a01e2982bc2872 (patch) | |
| tree | ad66214d6f64bba3a8a45c0b1d4ee8c7f1e2091d /tests | |
| parent | f420755d46f6b72e0bfa206fc846915fd9a085ae (diff) | |
Expand base64 tests to include roundtrip
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/core/encoding/base64/base64.odin | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/core/encoding/base64/base64.odin b/tests/core/encoding/base64/base64.odin index 6679c8ce2..ed1bee8af 100644 --- a/tests/core/encoding/base64/base64.odin +++ b/tests/core/encoding/base64/base64.odin @@ -36,3 +36,18 @@ test_decoding :: proc(t: ^testing.T) { testing.expect_value(t, v, test.vector) } } + +@(test) +test_roundtrip :: proc(t: ^testing.T) { + values: [1024]u8 + for &v, i in values[:] { + v = u8(i) + } + + encoded := base64.encode(values[:]); defer delete(encoded) + decoded := base64.decode(encoded); defer delete(decoded) + + for v, i in decoded { + testing.expect_value(t, v, values[i]) + } +}
\ No newline at end of file |