mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-13 06:04:31 +02:00
Porting to LUA 5.0 final
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
-- load tftpclnt.lua
|
||||
dofile("tftpclnt.lua")
|
||||
dofile("tftp.lua")
|
||||
|
||||
-- needs tftp server running on localhost, with root pointing to
|
||||
-- a directory with index.html in it
|
||||
@ -13,11 +13,8 @@ function readfile(file)
|
||||
end
|
||||
|
||||
host = host or "localhost"
|
||||
print("downloading")
|
||||
err = tftp_get(host, 69, "index.html", "index.got")
|
||||
retrieved, err = socket.tftp.get("tftp://" .. host .."/index.html")
|
||||
assert(not err, err)
|
||||
original = readfile("test/index.html")
|
||||
retrieved = readfile("index.got")
|
||||
os.remove("index.got")
|
||||
assert(original == retrieved, "files differ!")
|
||||
print("passed")
|
||||
|
Reference in New Issue
Block a user