1. Igor Baidiuk
  2. lua.channels

Commits

Igor Baidiuk  committed d777cf0

Added some test suites and a sketch for test suite launcher

  • Participants
  • Parent commits ff8bfc8
  • Branches default

Comments (0)

Files changed (6)

File tests/lua/get_no_name.lua

View file
+require "channels"
+

File tests/lua/importing.lua

-require "channels"
-
-local meta1 = {
-	foo = function (self) print("Hi folks!") end
-}
-
-local t1 = { }
-setmetatable(t1, meta1)
-
-meta1:foo()
-
-local chan1 = channels.new()
-local chanmeta = getmetatable(chan1)
-print(chanmeta)
-for k, v in pairs(chanmeta) do
-	print(k, "=", v)
-end
-
-chan1:send("foo")
-
-local foo = chan1:receive()
-print(foo)
-

File tests/lua/named_dupname.lua

View file
+require "channels"
+
+chan1 = channels.new("foo")
+chan2 = channles.new("foo")

File tests/lua/new_channel.lua

View file
+require "channels"
+
+chan = channels.new()

File tests/lua/new_named.lua

View file
+require "channels"
+
+chan = channels.new("foo")

File tests/test-suite.lua

View file
+
+require "channels"
+
+if _G['arg'] == nil then
+	error("Must be run as script (via lua executable)")
+end
+
+if #arg ~= 2 then
+	error(
+[[
+Should be executed with two arguments:
+1. Package path to where channels module is located
+2. Test script to execute
+]]
+	)
+end
+