summaryrefslogtreecommitdiff
path: root/tests/it_pipe.t
diff options
context:
space:
mode:
authorUrban Müller2017-09-27 16:02:05 +0200
committerUrban Müller2017-09-27 16:03:09 +0200
commit5d52cf51cc8cae4f29dc2c34e1a7e1993a68622d (patch)
tree2203644a1224823cfffd9329234483f3d2f004f1 /tests/it_pipe.t
parent4bf376c1a603caa7bd093a1c36817f8ea21180b1 (diff)
downloaditools-5d52cf51cc8cae4f29dc2c34e1a7e1993a68622d.tar.gz
itools-5d52cf51cc8cae4f29dc2c34e1a7e1993a68622d.tar.bz2
itools-5d52cf51cc8cae4f29dc2c34e1a7e1993a68622d.zip
allow 3-argument form of explode, it::match etc
Diffstat (limited to 'tests/it_pipe.t')
-rwxr-xr-xtests/it_pipe.t5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/it_pipe.t b/tests/it_pipe.t
index 93957b5..16e2c29 100755
--- a/tests/it_pipe.t
+++ b/tests/it_pipe.t
@@ -10,4 +10,9 @@ is(json_encode((new it_pipe(['data' => ["a\tb", "1\t2"]]))->csv("c,d")), '[{"c":
is(json_encode((new it_pipe(['data' => ["a\tb", "1\t2"]]))->csv(['forceschema' => "c,d"])), '[{"c":"1","d":"2"}]');
is(json_encode((new it_pipe(['data' => ["a b\tb", "1\t2"]]))->csv(['fixcolnames' => true])), '[{"a_b":"1","b":"2"}]');
+# askey()
is(json_encode((new it_pipe(['data' => "a\nb\n"]))->askey()), '{"a":true,"b":true}');
+
+# __call() generic funcs
+is((new it_pipe(['data' => [" a a "]]))->trim()->lines[0], "a a");
+is((new it_pipe(['data' => [" a a "]]))->it__match('\w', ['all' => true])->lines[0], ["a", "a"], "test argument in second pos");