File: 93-remove-family-field.lua

package info (click to toggle)
lua-cqueues 20200726-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,848 kB
  • sloc: ansic: 23,623; sh: 2,984; makefile: 24
file content (23 lines) | stat: -rwxr-xr-x 569 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
21
22
23
#!/bin/sh
_=[[
	. "${0%%/*}/regress.sh"
	exec runlua "$0" "$@"
]]
require"regress".export".*"

--
-- Simple test to check whether we broke initializing a socket object with a
-- pipe descriptor.
--
info"creating FILE handle attached to printf invocation"
local fh = check(io.popen("printf 'OK\\n'", "r"))

info"creating socket object attached to pipe (via FILE handle)"
local con = check(fileresult(socket.dup(fh)))

info"reading printed string from pipe"
local what = check(fileresult(con:read"*l"))

check(what == "OK", "expected 'OK' but got '%q'", what)

say("OK")