Mercurial Hosting > luan
comparison scripts/test.luan @ 539:473e456444ff
Remove object-oriented primitive methods for string and binary
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 01 Jun 2015 17:53:55 -0600 |
parents | 72610ddea6a7 |
children | c5a93767cc5c |
comparison
equal
deleted
inserted
replaced
538:919b9410008e | 539:473e456444ff |
---|---|
17 local Mail = require "luan:mail/Mail" | 17 local Mail = require "luan:mail/Mail" |
18 local Stripe = require "luan:stripe/Stripe" | 18 local Stripe = require "luan:stripe/Stripe" |
19 | 19 |
20 local error = Luan.error | 20 local error = Luan.error |
21 local range = Luan.range | 21 local range = Luan.range |
22 local trim = String.trim | |
23 local find = String.find | |
22 local init = Http_test.init | 24 local init = Http_test.init |
23 local get_page = Http_test.get_page | 25 local get_page = Http_test.get_page |
24 local Ab_testing = require "luan:lucene/Ab_testing" | 26 local Ab_testing = require "luan:lucene/Ab_testing" |
25 | 27 |
26 | 28 |
35 local page | 37 local page |
36 | 38 |
37 init() | 39 init() |
38 Http.request.parameter.code = "require('luan:Io').print 'hi'" | 40 Http.request.parameter.code = "require('luan:Io').print 'hi'" |
39 page = get_page "/run" | 41 page = get_page "/run" |
40 page.trim() == "hi" or error "failed" | 42 trim(page) == "hi" or error "failed" |
41 | 43 |
42 init() | 44 init() |
43 Http.request.parameter.cmd = "'ab'..'cd'" | 45 Http.request.parameter.cmd = "'ab'..'cd'" |
44 page = get_page "/shell" | 46 page = get_page "/shell" |
45 page.find "abcd" or error "failed" | 47 find(page,"abcd") or error "failed" |
46 | 48 |
47 init() | 49 init() |
48 page = get_page "/dump" | 50 page = get_page "/dump" |
49 | 51 |
50 | 52 |
105 init(); get_page "/examples/shell" | 107 init(); get_page "/examples/shell" |
106 | 108 |
107 init() | 109 init() |
108 Http.request.parameter.name = "bob" | 110 Http.request.parameter.name = "bob" |
109 page = get_page "/examples/hi2" | 111 page = get_page "/examples/hi2" |
110 page.find "bob" or error "failed" | 112 find(page,"bob") or error "failed" |
111 | 113 |
112 init() | 114 init() |
113 Http.request.parameter.name = "bob" | 115 Http.request.parameter.name = "bob" |
114 page = get_page "/examples/hi2_simply_html" | 116 page = get_page "/examples/hi2_simply_html" |
115 page.find "bob" or error "failed" | 117 find(page,"bob") or error "failed" |
116 | 118 |
117 | 119 |
118 print "done" | 120 print "done" |