Skip to content

Commit

Permalink
Add conformance tests for Encoders extension library (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
l46kok authored Jan 9, 2024
1 parent 8dd73bd commit 4f4944a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/simple/testdata/encoders_ext.textproto
Original file line number Diff line number Diff line change
@@ -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!"
}
}
}

0 comments on commit 4f4944a

Please sign in to comment.