Commit 1c53311e authored by Alberto Lerda's avatar Alberto Lerda Committed by Jaromil
Browse files

fix: create random statement assign coded to new object

parent 9ecd1c25
......@@ -25,6 +25,7 @@
When("create the random ''", function(dest)
ZEN.assert(not ACK[dest], "Cannot overwrite existing value: "..dest)
ACK[dest] = OCTET.random(32) -- TODO: right now hardcoded 256 bit random secrets
new_codec(dest, { zentype = 'element' })
end)
function shuffle_array_f(tab)
......
#!/usr/bin/env bash
DEBUG=1
####################
# common script init
if ! test -r ../utils.sh; then
echo "run executable from its own directory: $0"; exit 1; fi
. ../utils.sh
is_cortexm=false
if [[ "$1" == "cortexm" ]]; then
is_cortexm=true
fi
Z="`detect_zenroom_path` `detect_zenroom_conf`"
####################
set -e
cat <<EOF | zexe copy_random.zen
Given nothing
When I create the random 'random'
When I copy 'random' to 'dest'
Then print 'random'
Then print 'dest'
EOF
cat <<EOF >copy_data.json
{ "my_hex": "0011FFFF" }
EOF
cat <<EOF | zexe copy_data.zen -a copy_data.json
Given I have a 'hex' named 'my hex'
When I copy 'my hex' to 'dest'
Then print 'my hex'
Then print 'dest'
EOF
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment