diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2012-12-11 15:43:45 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2012-12-17 10:11:06 +0100 |
commit | cd9662eee3d728512527f794f1c7f576bd84b2fd (patch) | |
tree | 9ac14333f0da4fed17303b1b619b681f26a0429a /test/fwrite.lua | |
parent | bce5e3beab432a359a3d27b9caaf02160e3fb2cc (diff) | |
download | lem-cd9662eee3d728512527f794f1c7f576bd84b2fd.tar.gz lem-cd9662eee3d728512527f794f1c7f576bd84b2fd.tar.xz lem-cd9662eee3d728512527f794f1c7f576bd84b2fd.zip |
rename lem.streams to lem.io
Diffstat (limited to 'test/fwrite.lua')
-rwxr-xr-x | test/fwrite.lua | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/test/fwrite.lua b/test/fwrite.lua index f4e8856..d76485f 100755 --- a/test/fwrite.lua +++ b/test/fwrite.lua @@ -17,25 +17,19 @@ -- along with LEM. If not, see <http://www.gnu.org/licenses/>. -- -local utils = require 'lem.utils' -local stream = require 'lem.streams' +local utils = require 'lem.utils' +local io = require 'lem.io' -local write -do - local stdout = stream.stdout - function write(str) - return stdout:write(str) - end -end +local write = io.write print("Press enter to read '" .. (arg[1] or arg[0]) .. "'") -stream.stdin:read() +io.stdin:read() local threads = 2 for i = 1, threads do utils.spawn(function(n) - local file = assert(stream.open('file' .. tostring(n) .. '.txt', 'w')) - assert(getmetatable(file) == stream.File, "Hmm...") + local file = assert(io.open('file' .. tostring(n) .. '.txt', 'w')) + assert(getmetatable(file) == io.File, "Hmm...") print(tostring(n) .. '-1') assert(file:write('Hej!\n')) @@ -60,6 +54,6 @@ while threads > 0 do end print "\nDone. Press enter to continue." -stream.stdin:read() +io.stdin:read() -- vim: set ts=2 sw=2 noet: |