From b319e6a1e86a54c23b4848c5be7c0670f349a63f Mon Sep 17 00:00:00 2001
From: Diego Nehab <diego@tecgraf.puc-rio.br>
Date: Tue, 25 Sep 2001 21:32:52 +0000
Subject: updated due to test location changes

---
 test/tftptest.lua | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

(limited to 'test')

diff --git a/test/tftptest.lua b/test/tftptest.lua
index 7fb8253..1e9e1d5 100644
--- a/test/tftptest.lua
+++ b/test/tftptest.lua
@@ -1,16 +1,25 @@
 -- load tftpclng.lua
 assert(dofile("../examples/tftpclnt.lua"))
-assert(dofile("auxiliar.lua"))
 
 -- needs tftp server running on localhost, with root pointing to
 -- /home/i/diego/public/html/luasocket/test
 
-host = host or "localhost"
+function readfile(file)
+	local f = openfile("file", "rb")
+	local a 
+	if f then 
+		a = read(f, "*a")
+		closefile(f)
+	end
+	return a
+end
+
+host = host or "goya"
 print("downloading")
-err = tftp_get(host, 69, "test/index.html")
+err = tftp_get(host, 69, "index.html", "index.got")
 assert(not err, err)
-original = readfile("/home/i/diego/public/html/luasocket/test/index.html")
-retrieved = readfile("index.html")
-remove("index.html")
+original = readfile("index.index")
+retrieved = readfile("index.got")
+remove("index.got")
 assert(original == retrieved, "files differ!")
 print("passed")
-- 
cgit v1.2.3-55-g6feb