Mercurial Hosting > luan
comparison src/luan/modules/http/Http_test.luan @ 1270:d410747a671a
fix scripts/test.luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 12 Nov 2018 20:02:50 -0700 |
parents | f8dd726bd4f5 |
children | b3c4fcf29a53 |
comparison
equal
deleted
inserted
replaced
1269:bcb39089e899 | 1270:d410747a671a |
---|---|
28 else | 28 else |
29 local not_found = Package.load("site:/not_found.luan") | 29 local not_found = Package.load("site:/not_found.luan") |
30 not_found or error(path.." not found") | 30 not_found or error(path.." not found") |
31 not_found() | 31 not_found() |
32 end | 32 end |
33 Http_test.text_writer.close() | |
34 end | |
35 finally = function() | |
36 Io.stdout = old_out | |
37 end | |
38 } | |
39 return Http_test.result.read_text() | |
40 end | |
41 | |
42 function Http_test.run_page(page_fn) | |
43 local old_out = Io.stdout | |
44 try { | |
45 function() | |
46 page_fn() | |
33 Http_test.text_writer.close() | 47 Http_test.text_writer.close() |
34 end | 48 end |
35 finally = function() | 49 finally = function() |
36 Io.stdout = old_out | 50 Io.stdout = old_out |
37 end | 51 end |