Browse Source

updated zencode array transformations to avoid = symbols

master
Jaromil 1 year ago
parent
commit
e40c907529
4 changed files with 6 additions and 5 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -0
      build/tests.mk
  3. +2
    -3
      src/lua/zencode_eval.lua
  4. +2
    -2
      test/zencode_array.sh

+ 1
- 0
.gitignore View File

@@ -3,6 +3,7 @@
src/lualibs_detected.c
CMakeCache.*
CMakeFiles
lib/milagro-crypto-c/CPackConfig.cmake
CPack*
CTest*
config.log


+ 1
- 0
build/tests.mk View File

@@ -62,6 +62,7 @@ zencode-tests = \

zencode-integration = \
./test/zencode_parser.sh && \
./test/zencode_array.sh && \
cd test/zencode_simple && \
./run_symmetric_integration_test.sh ../../${1} && \
./run_aesgcm_integration_test.sh ../../${1} && \


+ 2
- 3
src/lua/zencode_eval.lua View File

@@ -72,7 +72,7 @@ return ]]..lfun
else return nil end
end

When("for each x='' y='' is true ''", function(X, Y, cond)
When("for each x in '' y in '' is true ''", function(X, Y, cond)
ZEN.assert(isarray(ACK[X]), "Array X not found: "..X)
ZEN.assert(isarray(ACK[Y]), "Array Y not found: "..Y)
ZEN.eval_condition(cond) -- check
@@ -85,7 +85,7 @@ When("for each x='' y='' is true ''", function(X, Y, cond)
"Checked condition failed on arr["..c.."]: " ..cond)
end
end)
When("for each '' create the array using ''", function(arr,fun)
When("for each x in '' create the array using ''", function(arr,fun)
ZEN.assert(isarray(ACK[arr]), "Array not found: "..arr)
ZEN.eval_function(fun) -- check
local c = 0
@@ -95,6 +95,3 @@ When("for each '' create the array using ''", function(arr,fun)
table.insert(ACK.array, ZEN.eval_function(fun,{x=v}))
end
end)



+ 2
- 2
test/zencode_array.sh View File

@@ -53,7 +53,7 @@ Given I have a valid array in 'bonnetjes'
and I have a valid array of 'ECP' in 'hashes'
# When I pick the random object in array 'hashes'
# and I remove the 'random object' from array 'hashes'
When for each x='hashes' y='bonnetjes' is true 'x == ECP.hashtopoint(y)'
When for each x in 'hashes' y in 'bonnetjes' is true 'x == ECP.hashtopoint(y)'
Then print the 'hashes'
EOF
# 'x == ECP.hashtopoint(y)'
@@ -63,7 +63,7 @@ cat <<EOF | zenroom -z -a $t/arr.json | json_pp
rule input encoding url64
rule output encoding url64
Given I have a valid array in 'bonnetjes'
When for each 'bonnetjes' create the array using 'sha256(x)'
When for each x in 'bonnetjes' create the array using 'sha256(x)'
Then print the 'array'
and print the 'bonnetjes'
EOF


Loading…
Cancel
Save