Currently what I am doing:
- Testing function by letting it zip a file/directory. Assert it exists.
- Using
:zip.t
and:zip.tt
let it list down the contents of the zip folder to see if it's what I am expecting.
Somehow I think I am missing something. Is it better to test with :zip.table
? The function looks confusing. Can someone provide an example of how to use it ? Below is an example of the output I got to, but I can't figure out how to make this into a test ? Is md5sum a better test for zip archives ?
iex(4)> :zip.table('testing.zip')
{:ok,
[{:zip_comment, []},
{:zip_file, 'mix.exs',
{:file_info, 930, :regular, :read_write, {{2015, 7, 15}, {2, 11, 9}},
{{2015, 7, 15}, {2, 11, 9}}, {{2015, 7, 15}, {2, 11, 9}}, 54, 1, 0, 0, 0, 0,
0}, [], 0, 444},
{:zip_file, 'mix.lock',
{:file_info, 332, :regular, :read_write, {{2015, 7, 15}, {2, 9, 6}},
{{2015, 7, 15}, {2, 9, 6}}, {{2015, 7, 15}, {2, 9, 6}}, 54, 1, 0, 0, 0, 0,
0}, [], 481, 152}]}