diff options
author | E. Westbrook <github@westbrook.io> | 2018-06-04 23:23:39 -0600 |
---|---|---|
committer | E. Westbrook <github@westbrook.io> | 2018-06-05 00:00:39 -0600 |
commit | 8fee6363093611302af3af5139eba9716267f03b (patch) | |
tree | beee9af67d33b0a073abe41b4efb49182f62404d /test | |
parent | 652959890943c34d7180cae372339b91e62f0d7b (diff) | |
download | luasocket-8fee6363093611302af3af5139eba9716267f03b.tar.gz luasocket-8fee6363093611302af3af5139eba9716267f03b.tar.bz2 luasocket-8fee6363093611302af3af5139eba9716267f03b.zip |
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) |