Mercurial Hosting > luan
comparison scripts/test.luan @ 1369:709f7498a363
change Lucene.index() and add Lucene.recover()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 19 Jun 2019 00:26:10 -0600 |
parents | d410747a671a |
children | 732b5de211fc |
comparison
equal
deleted
inserted
replaced
1368:5225cd6ed478 | 1369:709f7498a363 |
---|---|
34 init() | 34 init() |
35 Http.request.parameters.code = "require('luan:Io.luan').print 'hi'" | 35 Http.request.parameters.code = "require('luan:Io.luan').print 'hi'" |
36 page = run_page(require("luan:http/tools/Run.luan").respond) | 36 page = run_page(require("luan:http/tools/Run.luan").respond) |
37 trim(page) == "hi" or error "failed" | 37 trim(page) == "hi" or error "failed" |
38 | 38 |
39 --[[ | |
39 init() | 40 init() |
40 Http.request.parameters.cmd = "'ab'..'cd'" | 41 Http.request.parameters.cmd = "'ab'..'cd'" |
41 page = run_page(require("luan:http/tools/Shell.luan").respond) | 42 page = run_page(require("luan:http/tools/Shell.luan").respond) |
42 find(page,"abcd") or error "failed" | 43 find(page,"abcd") or error "failed" |
43 | 44 ]] |
44 | 45 |
45 -- lucene | 46 -- lucene |
46 | 47 |
47 local this_file = Io.schemes.file(Luan.arg[0]) | 48 local this_file = Io.schemes.file(Luan.arg[0]) |
48 local this_dir = this_file.parent() | 49 local this_dir = this_file.parent() |
49 local lucene_dir = this_dir.parent().child("build").child("lucene_test") | 50 local lucene_dir = this_dir.parent().child("build").child("lucene_test") |
50 --print(lucene_dir.to_string()) | 51 --print(lucene_dir.to_string()) |
51 local db = Lucene.index(lucene_dir.to_string()) | 52 local db = Lucene.index(lucene_dir) |
52 db.delete_all() | 53 db.delete_all() |
53 | 54 |
54 local Web_search = require "luan:lucene/Web_search.luan" | 55 local Web_search = require "luan:lucene/Web_search.luan" |
55 local web_search = Web_search.of(db) | 56 local web_search = Web_search.of(db) |
56 | 57 |
68 | 69 |
69 function Io.schemes.site(path) | 70 function Io.schemes.site(path) |
70 return Io.uri( "file:../website/src"..path ) | 71 return Io.uri( "file:../website/src"..path ) |
71 end | 72 end |
72 | 73 |
74 --[[ | |
73 init(); get_page "/" | 75 init(); get_page "/" |
74 init(); get_page "/docs.html" | 76 init(); get_page "/docs.html" |
75 init(); get_page "/tutorial.html" | 77 init(); get_page "/tutorial.html" |
76 init(); get_page "/pil.html" | 78 init(); get_page "/pil.html" |
77 init(); get_page "/manual.html" | 79 init(); get_page "/manual.html" |
78 init(); get_page "/diff.html" | 80 init(); get_page "/diff.html" |
81 ]] | |
79 init(); get_page "/examples/hi.html" | 82 init(); get_page "/examples/hi.html" |
80 init(); get_page "/examples/hi2.html" | 83 init(); get_page "/examples/hi2.html" |
81 init(); get_page "/examples/shell.html" | 84 init(); get_page "/examples/shell.html" |
82 | 85 |
83 init() | 86 init() |