Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zenroom
Zenroom
Commits
1c53311e
Commit
1c53311e
authored
May 06, 2022
by
Alberto Lerda
Committed by
Jaromil
May 16, 2022
Browse files
fix: create random statement assign coded to new object
parent
9ecd1c25
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lua/zencode_random.lua
View file @
1c53311e
...
...
@@ -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
)
...
...
test/zencode_when/run.sh
0 → 100755
View file @
1c53311e
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment