diff options
author | Diego Nehab <diego.nehab@gmail.com> | 2018-06-05 09:56:59 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 09:56:59 -0300 |
commit | cc42bcbf80c8184d64d9fe28ef8d18472f49ba76 (patch) | |
tree | beee9af67d33b0a073abe41b4efb49182f62404d /test | |
parent | 652959890943c34d7180cae372339b91e62f0d7b (diff) | |
parent | 8fee6363093611302af3af5139eba9716267f03b (diff) | |
download | luasocket-cc42bcbf80c8184d64d9fe28ef8d18472f49ba76.tar.gz luasocket-cc42bcbf80c8184d64d9fe28ef8d18472f49ba76.tar.bz2 luasocket-cc42bcbf80c8184d64d9fe28ef8d18472f49ba76.zip |
Merge pull request #251 from ewestbrook/ltn12tblsrc
Add ltn12.source.table()
Diffstat (limited to 'test')
-rw-r--r-- | test/ltn12test.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ltn12test.lua b/test/ltn12test.lua index e3f85fb..e7d368d 100644 --- a/test/ltn12test.lua +++ b/test/ltn12test.lua | |||
@@ -181,6 +181,15 @@ assert(table.concat(t) == s, "mismatch") | |||
181 | print("ok") | 181 | print("ok") |
182 | 182 | ||
183 | -------------------------------- | 183 | -------------------------------- |
184 | io.write("testing source.table: ") | ||
185 | local inp = {'a','b','c','d','e'} | ||
186 | local source = ltn12.source.table(inp) | ||
187 | sink, t = ltn12.sink.table() | ||
188 | assert(ltn12.pump.all(source, sink), "returned error") | ||
189 | for i = 1, #inp do assert(t[i] == inp[i], "mismatch") end | ||
190 | print("ok") | ||
191 | |||
192 | -------------------------------- | ||
184 | io.write("testing source.chain (with split): ") | 193 | io.write("testing source.chain (with split): ") |
185 | source = ltn12.source.string(s) | 194 | source = ltn12.source.string(s) |
186 | filter = split(5) | 195 | filter = split(5) |