1 -- $Id: apptest.lua,v 1.7 2005/02/02 22:26:20 cpressey Exp $
7 name = "Test application",
8 logfile = "testapp.log",
15 print("OS is: " .. App.os.name)
17 -- Create a storage-descriptor for the application.
18 App.state.storage = StorageDescriptor.new()
19 App.state.storage:survey()
21 print(App.expand("The root is ``${root}'' and the temp dir is ``${tmp}''."))
22 print(App.expand("And cpdup is ``${CPDUP}''."))
23 print(App.expand("And boo is ``${BOO}''."))
25 t1 = App.open_tmpfile("foo.txt", "w")
27 t1:write("This goes into foo.txt.")
30 App.log_warn("Can't open ${tmp}/foo.txt!")
33 t2, t2_name = App.open_tmpfile()
35 t2:write("This goes into some file called " .. t2_name .. ".")
38 App.log_warn("Can't open ${tmp}/" .. t2_name .. "!")
41 t1 = App.open_tmpfile("foo.txt", "r")
43 for line in t1:lines() do print("foo.txt:", line) end
47 t2 = App.open_tmpfile(t2_name, "r")
49 for line in t2:lines() do print(t2_name .. ":", line) end
55 if App.ui:confirm("Confirm dialog test. Show an inform dialog?") then
56 App.ui:inform("Inform dialog test.")