mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-03-04 10:38:12 +00:00
Make the key for mtime "modified" in fs.attributes (#512)
This commit is contained in:
parent
fe00e00537
commit
0e2ce3c634
@ -479,6 +479,7 @@ public class FSAPI implements ILuaAPI
|
|||||||
BasicFileAttributes attributes = fileSystem.getAttributes( path );
|
BasicFileAttributes attributes = fileSystem.getAttributes( path );
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put( "modification", getFileTime( attributes.lastModifiedTime() ) );
|
result.put( "modification", getFileTime( attributes.lastModifiedTime() ) );
|
||||||
|
result.put( "modified", getFileTime( attributes.lastModifiedTime() ) );
|
||||||
result.put( "created", getFileTime( attributes.creationTime() ) );
|
result.put( "created", getFileTime( attributes.creationTime() ) );
|
||||||
result.put( "size", attributes.isDirectory() ? 0 : attributes.size() );
|
result.put( "size", attributes.isDirectory() ? 0 : attributes.size() );
|
||||||
result.put( "isDir", attributes.isDirectory() );
|
result.put( "isDir", attributes.isDirectory() );
|
||||||
|
@ -208,9 +208,11 @@ describe("The fs library", function()
|
|||||||
fail(("Expected created time (%d) to be within 1000ms of now (%d"):format(attributes.created, now))
|
fail(("Expected created time (%d) to be within 1000ms of now (%d"):format(attributes.created, now))
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes.modification - now >= 1000 then
|
if attributes.modified - now >= 1000 then
|
||||||
fail(("Expected modification time (%d) to be within 1000ms of now (%d"):format(attributes.modification, now))
|
fail(("Expected modified time (%d) to be within 1000ms of now (%d"):format(attributes.modified, now))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
expect(attributes.modification):eq(attributes.modified)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user