diff --git a/tests/simple/testdata/encoders_ext.textproto b/tests/simple/testdata/encoders_ext.textproto new file mode 100644 index 0000000..f475240 --- /dev/null +++ b/tests/simple/testdata/encoders_ext.textproto @@ -0,0 +1,42 @@ +name: "encoders_ext" +description: "Tests for the encoders extension library." +section: { + name: "encode" + test: { + name: "hello" + expr: "base64.encode(b'hello')" + value: { + string_value: "aGVsbG8=" + } + } +} + +section: { + name: "decode" + test: { + name: "hello" + expr: "base64.decode('aGVsbG8=')" + value: { + bytes_value: "hello" + } + } + test: { + name: "hello_without_padding" + expr: "base64.decode('aGVsbG8')" + value: { + bytes_value: "hello" + } + } +} + +section: { + name: "round_trip" + test: { + name: "hello" + expr: "base64.decode(base64.encode(b'Hello World!'))" + value: { + bytes_value: "Hello World!" + } + } +} +