Expand base64 tests to include roundtrip

This commit is contained in:
Jeroen van Rijn
2025-11-22 15:44:19 +01:00
parent f420755d46
commit 1fb95dade2

View File

@@ -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])
}
}