File: test.lua

package info (click to toggle)
dnsjit 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,928 kB
  • sloc: ansic: 9,670; makefile: 328; sh: 193
file content (19 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local ffi = require("ffi")
local zero = require("example.input.zero").new()
local counter = require("example.filter.counter").new()
local null = require("example.output.null").new()

-- set the counter to receive objects created by zero
zero:receiver(counter)
-- set the null to receive objects passed through counter
counter:receiver(null)

-- run and create 10 objects
zero:run(10)

if counter:count() == 10 then
    print("loading and usage successful, counted "..counter:count().." objects")
    os.exit(0)
end

os.exit(1)