comparison scripts/test.luan @ 1716:b82767112d8e

add String.regex
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 24 Jul 2022 23:43:03 -0600
parents 82415c9c0015
children
comparison
equal deleted inserted replaced
1715:ad44e849c60c 1716:b82767112d8e
15 local Mail = require "luan:mail/Mail.luan" 15 local Mail = require "luan:mail/Mail.luan"
16 16
17 local error = Luan.error 17 local error = Luan.error
18 local range = Luan.range or error() 18 local range = Luan.range or error()
19 local trim = String.trim or error() 19 local trim = String.trim or error()
20 local find = String.find or error() 20 local contains = String.contains or error()
21 local init = Http_test.init or error() 21 local init = Http_test.init or error()
22 local get_page = Http_test.get_page or error() 22 local get_page = Http_test.get_page or error()
23 local run_page = Http_test.run_page or error() 23 local run_page = Http_test.run_page or error()
24 24
25 25
36 36
37 --[[ 37 --[[
38 init() 38 init()
39 Http.request.parameters.cmd = "'ab'..'cd'" 39 Http.request.parameters.cmd = "'ab'..'cd'"
40 page = run_page(require("luan:http/tools/Shell.luan").respond) 40 page = run_page(require("luan:http/tools/Shell.luan").respond)
41 find(page,"abcd") or error "failed" 41 contains(page,"abcd") or error "failed"
42 ]] 42 ]]
43 43
44 -- lucene 44 -- lucene
45 45
46 local this_file = Io.schemes.file(Luan.arg[0]) 46 local this_file = Io.schemes.file(Luan.arg[0])
82 init(); get_page "/examples/shell.html" 82 init(); get_page "/examples/shell.html"
83 83
84 init() 84 init()
85 Http.request.parameters.name = "bob" 85 Http.request.parameters.name = "bob"
86 page = get_page "/examples/hi2.html" 86 page = get_page "/examples/hi2.html"
87 find(page,"bob") or error "failed" 87 contains(page,"bob") or error "failed"
88 88
89 89
90 print "done" 90 print "done"