File: test-job-query.lua

package info (click to toggle)
lua-penlight 1.0.2%2Bhtmldoc-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,860 kB
  • sloc: makefile: 7
file content (20 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'pl'

utils.on_error 'quit'

stuff = [[
Department Name,Employee ID,Project,Hours Booked
sales, 1231,overhead,4
sales,1255,overhead,3
engineering,1501,development,5
engineering,1501,maintenance,3
engineering,1433,maintenance,10
]]

t = data.read(stringio.open(stuff))

q = t:select 'Employee_ID,Hours_Booked where Department_Name == "engineering"'

test.asserteq2(1501,5,q())
test.asserteq2(1501,3,q())
test.asserteq2(1433,10,q())