Skip to content

Commit 60cd591

Browse files
committed
test(logic): describe base64/2 feature
1 parent 05586fb commit 60cd591

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Feature: base64/2
2+
This feature is to test the base64/2 predicate.
3+
4+
@great_for_documentation
5+
Scenario: Encode and decode a string into a Base64 encoded atom
6+
This scenario demonstrates how to encode an decode a plain string into a Base64-encoded atom using the `base64/2`
7+
predicate.
8+
9+
Given the query:
10+
""" prolog
11+
base64url('Hello world', Encoded),
12+
base64url(Decoded, 'SGVsbG8gd29ybGQ').
13+
"""
14+
When the query is run
15+
Then the answer we get is:
16+
""" yaml
17+
height: 42
18+
gas_used: 3976
19+
answer:
20+
has_more: false
21+
variables: ["Encoded", "Decoded"]
22+
results:
23+
- substitutions:
24+
- variable: Encoded
25+
expression: "'SGVsbG8gd29ybGQ'"
26+
- variable: Decoded
27+
expression: "'Hello world'"
28+
"""

0 commit comments

Comments
 (0)