From 4437e194558279b31878965d1c4b2188b1a8cf39 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 9 Aug 2014 12:33:33 +0200 Subject: Fix lfs.attributes(file, 'blksize') fs.attributes(file, 'blksize') and fs.attributes(file, 'blocks) return the wrong values. Compare the whole attribute name instead of the first char and remove buggy special casing with wrong indexes into the member array. --- tests/test.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test.lua') diff --git a/tests/test.lua b/tests/test.lua index 4990aec..abfbd4d 100644 --- a/tests/test.lua +++ b/tests/test.lua @@ -120,6 +120,13 @@ assert (new_att.modification == attrib.modification) io.write(".") io.flush() +-- Check consistency of lfs.attributes values +local attr = lfs.attributes (tmpfile) +for key, value in pairs(attr) do + assert (value == lfs.attributes (tmpfile, key), + "lfs.attributes values not consistent") +end + -- Remove new file and directory assert (os.remove (tmpfile), "could not remove new file") assert (lfs.rmdir (tmpdir), "could not remove new directory") -- cgit v1.2.3-55-g6feb