comparison lucene/src/luan/modules/lucene/Ab_testing.luan @ 505:7bc63886d4f2

web page modules now return a function
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 May 2015 01:45:49 -0600
parents 92c3d22745b8
children 473e456444ff
comparison
equal deleted inserted replaced
504:dbdf4b8193a8 505:7bc63886d4f2
131 end 131 end
132 return values 132 return values
133 end 133 end
134 134
135 function ab_testing.web_page(test_names) 135 function ab_testing.web_page(test_names)
136 return { respond = function() 136 return function()
137 local results = {} 137 local results = {}
138 for _, name in ipairs(test_names) do 138 for _, name in ipairs(test_names) do
139 local test = ab_testing.test_map[name] 139 local test = ab_testing.test_map[name]
140 test or error("test not found: "..name) 140 test or error("test not found: "..name)
141 results[name] = test.fancy_results() 141 results[name] = test.fancy_results()
142 end 142 end
143 Io.stdout = Http.response.text_writer() 143 Io.stdout = Http.response.text_writer()
144 M.html(test_names,ab_testing.test_map,results) 144 M.html(test_names,ab_testing.test_map,results)
145 end } 145 end
146 end 146 end
147 147
148 return ab_testing 148 return ab_testing
149 end 149 end
150 150