Mercurial Hosting > luan
comparison src/luan/modules/http/Http_test.luan @ 1340:b3c4fcf29a53
fix values() and minor Http_test
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 18 Feb 2019 05:11:50 -0700 |
| parents | d410747a671a |
| children | d9a5405a3102 |
comparison
equal
deleted
inserted
replaced
| 1339:f61df1aee8e1 | 1340:b3c4fcf29a53 |
|---|---|
| 20 path = path .. Http_test.welcome_file | 20 path = path .. Http_test.welcome_file |
| 21 end | 21 end |
| 22 local old_out = Io.stdout | 22 local old_out = Io.stdout |
| 23 try { | 23 try { |
| 24 function() | 24 function() |
| 25 local mod = Package.load("site:"..path..".luan") | 25 local mod = Package.load("site:"..path..".luan") or error(path.." not found") |
| 26 if mod and true then | 26 mod() |
| 27 mod() | |
| 28 else | |
| 29 local not_found = Package.load("site:/not_found.luan") | |
| 30 not_found or error(path.." not found") | |
| 31 not_found() | |
| 32 end | |
| 33 Http_test.text_writer.close() | 27 Http_test.text_writer.close() |
| 34 end | 28 end |
| 35 finally = function() | 29 finally = function() |
| 36 Io.stdout = old_out | 30 Io.stdout = old_out |
| 37 end | 31 end |
