Skip to content

Commit

Permalink
test(zencode): add test for import and export of empty strings in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino authored and jaromil committed May 13, 2024
1 parent b66ba9a commit 5416c9a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/zencode/then.bats
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,27 @@ EOF
save_output 'dictionary_string_float_time.out'
assert_output '{"dictionary":{"num":1.234568e+10,"str":"hello world!","time":1702474699}}'
}

@test "Tables with empty strings" {
cat <<EOF | save_asset tables_with_empty_strings.json
{
"dictionary": {
"str": "hello world!",
"empty_str": "",
"another_str": "goodbye world!",
},
"array": [
"hello world!",
"",
"goodbye world!"
]
}
EOF
cat <<EOF | zexe tables_with_empty_strings.zen tables_with_empty_strings.json
Given I have the 'string dictionary' named 'dictionary'
Given I have the 'string array' named 'array'
Then print all data
EOF
save_output 'tables_with_empty_strings.out'
assert_output '{"array":["hello world!","","goodbye world!"],"dictionary":{"another_str":"goodbye world!","empty_str":"","str":"hello world!"}}'
}

0 comments on commit 5416c9a

Please sign in to comment.