Mercurial Hosting > luan
comparison web/src/luan/modules/web/test.luan @ 271:82a3ebcfbafa
add internal tests
git-svn-id: https://luan-java.googlecode.com/svn/trunk@272 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 31 Oct 2014 04:27:50 +0000 |
parents | |
children | eb27e765affb |
comparison
equal
deleted
inserted
replaced
270:b2c20fdcf42a | 271:82a3ebcfbafa |
---|---|
1 import "luan:Io" | |
2 import "luan:web/Http" | |
3 | |
4 | |
5 local function print(...) | |
6 Io.print_to(Io.stderr,...) | |
7 end | |
8 | |
9 function Io.protocols.site(path,loading) | |
10 return Io.Uri( "luan:web"..path, loading ) | |
11 end | |
12 | |
13 | |
14 Http.init_for_test() | |
15 Http.request.parameters.code = "print 'hi'" | |
16 page = Http.get_page "/web_run" | |
17 assert( page.trim() == "hi" ) | |
18 | |
19 Http.init_for_test() | |
20 Http.request.parameters.cmd = "'ab'..'cd'" | |
21 page = Http.get_page "/web_shell" | |
22 assert( page.find "abcd" ) |